about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorNicolas Koch <nioko1337@gmail.com>2018-05-16 10:21:34 +0200
committerNicolas Koch <nioko1337@gmail.com>2018-05-16 10:21:34 +0200
commitb605923cc83a444f6be52542b891d31b00c87662 (patch)
tree2341dfe43fdd524c231da7c66cde34f948460a44 /src/libstd/sys
parent00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095 (diff)
downloadrust-b605923cc83a444f6be52542b891d31b00c87662.tar.gz
rust-b605923cc83a444f6be52542b891d31b00c87662.zip
Add clarifying comment about offset argument
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/fs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs
index 42dc7b83da9..0649a147ea3 100644
--- a/src/libstd/sys/unix/fs.rs
+++ b/src/libstd/sys/unix/fs.rs
@@ -816,6 +816,8 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
     let mut written = 0u64;
     while written < len {
         let copy_result = unsafe {
+            // We actually don't have to adjust the offsets,
+            // because copy_file_range adjusts the file offset automatically
             cvt(copy_file_range(reader.as_raw_fd(),
                                 ptr::null_mut(),
                                 writer.as_raw_fd(),