diff options
| author | Nicolas Koch <nioko1337@gmail.com> | 2018-05-16 10:21:34 +0200 |
|---|---|---|
| committer | Nicolas Koch <nioko1337@gmail.com> | 2018-05-16 10:21:34 +0200 |
| commit | b605923cc83a444f6be52542b891d31b00c87662 (patch) | |
| tree | 2341dfe43fdd524c231da7c66cde34f948460a44 /src/libstd/sys | |
| parent | 00ec3cf2a0449f41bd3cb873bc9b2cf1b6241095 (diff) | |
| download | rust-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.rs | 2 |
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(), |
