Initializes copy_file_data implementation pointer
| 1005 | |
| 1006 | //! Initializes copy_file_data implementation pointer |
| 1007 | inline void init_copy_file_data_impl(unsigned int major_ver, unsigned int minor_ver, unsigned int patch_ver) |
| 1008 | { |
| 1009 | #if defined(BOOST_FILESYSTEM_USE_SENDFILE) || defined(BOOST_FILESYSTEM_USE_COPY_FILE_RANGE) |
| 1010 | copy_file_data_t* cfd = ©_file_data_read_write; |
| 1011 | |
| 1012 | #if defined(BOOST_FILESYSTEM_USE_SENDFILE) |
| 1013 | // sendfile started accepting file descriptors as the target in Linux 2.6.33 |
| 1014 | if (major_ver > 2u || (major_ver == 2u && (minor_ver > 6u || (minor_ver == 6u && patch_ver >= 33u)))) |
| 1015 | cfd = &check_fs_type< copy_file_data_preallocate< copy_file_data_sendfile > >; |
| 1016 | #endif |
| 1017 | |
| 1018 | #if defined(BOOST_FILESYSTEM_USE_COPY_FILE_RANGE) |
| 1019 | // Although copy_file_range appeared in Linux 4.5, it did not support cross-filesystem copying until 5.3. |
| 1020 | // copy_file_data_copy_file_range will fallback to copy_file_data_sendfile if copy_file_range returns EXDEV. |
| 1021 | if (major_ver > 4u || (major_ver == 4u && minor_ver >= 5u)) |
| 1022 | cfd = &check_fs_type< copy_file_data_preallocate< copy_file_data_copy_file_range > >; |
| 1023 | #endif |
| 1024 | |
| 1025 | filesystem::detail::atomic_store_relaxed(copy_file_data, cfd); |
| 1026 | #endif // defined(BOOST_FILESYSTEM_USE_SENDFILE) || defined(BOOST_FILESYSTEM_USE_COPY_FILE_RANGE) |
| 1027 | } |
| 1028 | |
| 1029 | #endif // defined(linux) || defined(__linux) || defined(__linux__) |
| 1030 |
no test coverage detected