[libcxx-commits] [libcxx] [libc++] use copy_file_range for fs::copy (PR #109211)
Jannik Glückert via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 2 00:36:24 PDT 2024
================
@@ -173,6 +173,12 @@ if (APPLE AND LLVM_USE_SANITIZER)
endif()
endif()
+include(CheckCXXSymbolExists)
+check_cxx_symbol_exists("copy_file_range" "unistd.h" LIBCXX_USE_COPY_FILE_RANGE)
+if(LIBCXX_USE_COPY_FILE_RANGE)
+ list(APPEND LIBCXX_COMPILE_FLAGS "-D_LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE")
+endif()
----------------
Jannik2099 wrote:
since linux 4.5, according to the man page. RHEL 8 is at linux 4.18, for comparison. I don't think any still supported distro uses < 4.5
On FreeBSD, it has been added in FreeBSD 13, and FreeBSD 12.x went EoL on 31. December 2023
So yeah, if you want I'll just drop this and do an `#ifdef __linux__ || __FreeBSD__`
https://github.com/llvm/llvm-project/pull/109211
More information about the libcxx-commits
mailing list