[libcxx-commits] [libcxx] [libc++] fix largefile handling in fs::copy_file (PR #121855)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 6 15:34:23 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Jannik Glückert (Jannik2099)
<details>
<summary>Changes</summary>
fix for https://github.com/llvm/llvm-project/pull/109211
---
Full diff: https://github.com/llvm/llvm-project/pull/121855.diff
1 Files Affected:
- (modified) libcxx/src/filesystem/operations.cpp (+6)
``````````diff
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;
``````````
</details>
https://github.com/llvm/llvm-project/pull/121855
More information about the libcxx-commits
mailing list