Skip to content

Commit b605923

Browse files
committed
Add clarifying comment about offset argument
1 parent 00ec3cf commit b605923

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/sys/unix/fs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
816816
let mut written = 0u64;
817817
while written < len {
818818
let copy_result = unsafe {
819+
// We actually don't have to adjust the offsets,
820+
// because copy_file_range adjusts the file offset automatically
819821
cvt(copy_file_range(reader.as_raw_fd(),
820822
ptr::null_mut(),
821823
writer.as_raw_fd(),

0 commit comments

Comments
 (0)