From 19113a4d95d0dbcf8794659050926801dacd9c0c Mon Sep 17 00:00:00 2001 From: Raman Shyshniou Date: Sat, 22 Nov 2025 21:03:14 +0300 Subject: [PATCH] [libc++][FreeBSD] use copy_file_range() in FreeBSD >= 13.0 --- libcxx/src/filesystem/operations.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp index b71f94a89d6df..e58486bf5cbbd 100644 --- a/libcxx/src/filesystem/operations.cpp +++ b/libcxx/src/filesystem/operations.cpp @@ -50,7 +50,10 @@ # define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE # endif #elif defined(__FreeBSD__) -# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE +# include +# if __FreeBSD_version >= 1300000 +# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE +# endif #endif #if __has_include() # include