-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io::copy() might be trying to use invalid file descriptor #122052
Comments
This seems to be intentional and not a bug: rust/library/std/src/sys/pal/unix/kernel_copy.rs Lines 579 to 581 in 8039906
It's probing whether the syscall |
If it's obvious from the actual syscall results themselves that the syscall is supported or unsupported, don't do an extra syscall with an invalid file descriptor. CC rust-lang#122052
If it's obvious from the actual syscall results themselves that the syscall is supported or unsupported, don't do an extra syscall with an invalid file descriptor. CC rust-lang#122052
…8472 Less syscalls for the `copy_file_range` probe If it's obvious from the actual syscall results themselves that the syscall is supported or unsupported, don't do an extra syscall with an invalid file descriptor. CC rust-lang#122052
Triage: Since this behavior seemingly is intentional, let's close as "not a bug". |
It was also changed in #122079 to only trigger in the error case. The example program will no longer trigger the invalid file descriptor warning. |
Code:
If I ensure "foo" exists and run the above program under valgrind on Linux, I get:
The docs say
copy_file_range
may be used on Linux. Maybe it is used incorrectly? The file does get copied though.This warning appears when the program is built with stable (1.76.0) and nightly.
The text was updated successfully, but these errors were encountered: