Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions libcxx/src/filesystem/operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@
#include <fcntl.h> /* values for fchmodat */
#include <time.h>

// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc and musl
#if (defined(__linux__) && (defined(__GLIBC__) || _LIBCPP_HAS_MUSL_LIBC)) || defined(__FreeBSD__)
// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl
#if defined(__linux__)
# if defined(_LIBCPP_GLIBC_PREREQ)
# if _LIBCPP_GLIBC_PREREQ(2, 27)
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
# endif
# elif _LIBCPP_HAS_MUSL_LIBC
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
# endif
#elif defined(__FreeBSD__)
# define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE
#endif
#if __has_include(<sys/sendfile.h>)
Expand Down
Loading