]> git.lizzy.rs Git - rust.git/commitdiff
Add clarifying comment about offset argument
authorNicolas Koch <nioko1337@gmail.com>
Wed, 16 May 2018 08:21:34 +0000 (10:21 +0200)
committerNicolas Koch <nioko1337@gmail.com>
Wed, 16 May 2018 08:21:34 +0000 (10:21 +0200)
src/libstd/sys/unix/fs.rs

index 42dc7b83da9687da214a5a9d1fc38b86b9f9f815..0649a147ea3c1ace24e3d7c5e183c3a6884cc3f8 100644 (file)
@@ -816,6 +816,8 @@ unsafe fn copy_file_range(
     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(),