10
Github Fix io::copy specialization using copy_file_range when writer was opened...
source link: https://github.com/rust-lang/rust/pull/82417
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
fixes #82410
While sendfile()
returns EINVAL
when the output was opened with O_APPEND, copy_file_range()
does not and returns EBADF
instead, which – unlike other EBADF
causes – is not fatal for this operation since a regular write()
will likely succeed.
We now treat EBADF
as a non-fatal error for copy_file_range
and fall back to a read-write copy as we already did for several other errors.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK