Skip to content

Commit faa3f75

Browse files
authored
[libc++] Fix largefile handling in fs::copy_file (llvm#121855)
Fix for issues reported in llvm#109211
1 parent ab5133b commit faa3f75

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libcxx/src/filesystem/operations.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,14 @@ bool copy_file_impl_copy_file_range(FileDescriptor& read_fd, FileDescriptor& wri
238238
return false;
239239
}
240240
// do not modify the fd positions as copy_file_impl_sendfile may be called after a partial copy
241+
# if defined(__linux__)
242+
loff_t off_in = 0;
243+
loff_t off_out = 0;
244+
# else
241245
off_t off_in = 0;
242246
off_t off_out = 0;
247+
# endif
248+
243249
do {
244250
ssize_t res;
245251

0 commit comments

Comments
 (0)