[libcxx-commits] [libcxx] [libc++] use copy_file_range for fs::copy (PR #109211)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 1 07:26:27 PDT 2024


Jannik =?utf-8?q?Glückert?= <jannik.glueckert at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/109211 at github.com>


================
@@ -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()
----------------
ldionne wrote:

What Linux versions don't provide `copy_file_range`? I'd rather assume support from the OS or test for something general like `#ifdef __linux__` in `operations.cpp` than add a CMake check for a single OS feature like this.

https://github.com/llvm/llvm-project/pull/109211


More information about the libcxx-commits mailing list