Skip to content

Commit dbaa5fe

Browse files
committed
[libcxx] Fix build for glibc < 2.27
PR llvm#109211 introduced a build break on systems with glibc < 2.27, since copy_file_range was only introduced after that version. A version check is added to prevent this breakage.
1 parent 8d2e611 commit dbaa5fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/src/filesystem/operations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#include <fcntl.h> /* values for fchmodat */
4040
#include <time.h>
4141

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

0 commit comments

Comments
 (0)