-
Notifications
You must be signed in to change notification settings - Fork 666
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
Expose copy_file_range on FreeBSD and use I/O Safety #1906
Conversation
66a79a1
to
fbf6470
Compare
@rtzoeller suddenly I'm getting a bunch of errors on musl, android, and qemu. But I can't figure out why they didn't happen before this PR. Any guesses?
Even before this PR, copy_file_range should've been enabled for all of those targets. |
Oh, I see. The old version used |
fbf6470
to
497bd4b
Compare
63fa5ae
to
9a59112
Compare
9a59112
to
fa8983e
Compare
And expose it on FreeBSD
fa8983e
to
5d55d8f
Compare
Two major changes: - features must be included; we only need two (this will speed up compiles!) - FD safety; we now need an OwnedFd, so attempting to use the fd after the object is dropped is no longer valid. Additionally, we don't need to implement Drop, as OwnedFd already has a drop which calls close References: * [https://github.com/nix-rust/nix/pull/2091](nix PR for features drop) * [https://doc.rust-lang.org/stable/src/std/os/fd/owned.rs.html#170-182](OwnedFd docs) * [https://github.com/nix-rust/nix/pull/1906](nix PR for FD I/O safety)
Two major changes: - features must be included; we only need two (this will speed up compiles!) - FD safety; we now need an OwnedFd, so attempting to use the fd after the object is dropped is no longer valid. Additionally, we don't need to implement Drop, as OwnedFd already has a drop which calls close References: * nix-rust/nix#2091 - nix PR for features drop * https://doc.rust-lang.org/stable/src/std/os/fd/owned.rs.html#170-182 - OwnedFd docs * nix-rust/nix#1906 - nix PR for FD I/O safety
Depends on #1862