[libcxx-commits] [libcxx] faa3f75 - [libc++] Fix largefile handling in fs::copy_file (#121855)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 7 06:29:44 PST 2025
Author: Jannik Glückert
Date: 2025-01-07T09:29:35-05:00
New Revision: faa3f752896903c2d09d389970d3d0ebf50a1073
URL: https://github.com/llvm/llvm-project/commit/faa3f752896903c2d09d389970d3d0ebf50a1073
DIFF: https://github.com/llvm/llvm-project/commit/faa3f752896903c2d09d389970d3d0ebf50a1073.diff
LOG: [libc++] Fix largefile handling in fs::copy_file (#121855)
Fix for issues reported in https://github.com/llvm/llvm-project/pull/109211
Added:
Modified:
libcxx/src/filesystem/operations.cpp
Removed:
################################################################################
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index bd37c5af86f6c3..208a55723d8838 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -238,8 +238,14 @@ bool copy_file_impl_copy_file_range(FileDescriptor& read_fd, FileDescriptor& wri
return false;
}
// do not modify the fd positions as copy_file_impl_sendfile may be called after a partial copy
+# if defined(__linux__)
+ loff_t off_in = 0;
+ loff_t off_out = 0;
+# else
off_t off_in = 0;
off_t off_out = 0;
+# endif
+
do {
ssize_t res;
More information about the libcxx-commits
mailing list