Uh oh!
There was an error while loading. Please reload this page.
Remove Linux workarounds for missing CLOEXEC support - #74606
Conversation
Now that rust-lang#74163 updated the minimum Linux kernel to 2.6.32, we can assume the availability of APIs that open file descriptors that are already set to close on exec, including the flags `O_CLOEXEC`, `SOCK_CLOEXEC`, and `F_DUPFD_CLOEXEC`.
rust-highfive
commented
Jul 21, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
withoutboats
commented
Jul 21, 2020
| // supported (the third parameter, 0, is always valid), so we stop | ||
| // trying that. | ||
| // | ||
| // Also note that Android doesn't have F_DUPFD_CLOEXEC, but get it to |
There was a problem hiding this comment.
Is this note about android not relevant anymore?
There was a problem hiding this comment.
I think at the time that flag wasn't in Android's headers, but the implementation details for fcntl are all handled in the kernel anyway. AFAICT 2.6.24 is older than any Android kernel that ever shipped.
The libc crate moved the Linux definition of the flag to include Android in rust-lang/libc@b43118c.
Uh oh!
There was an error while loading. Please reload this page.
| // There are a variety of `#[cfg]`s controlling which targets are involved in | ||
| // each instance of `weak!` and `syscall!`. Rather than trying to unify all of | ||
| // that, we'll just allow that some unix targets don't use this module at all. | ||
| #![allow(dead_code, unused_macros)] |
There was a problem hiding this comment.
A bit unfortunate, but probably cleaner than trying to figure out the exact cfg needed.
sfackler
commented
Jul 23, 2020
@bors r+ |
bors
commented
Jul 23, 2020
📌 Commit ae06e13 has been approved by |
bors
commented
Jul 23, 2020
🌲 The tree is currently closed for pull requests below priority 5, this pull request will be tested once the tree is reopened |
…arth Rollup of 8 pull requests Successful merges: - rust-lang#74141 (libstd/libcore: fix various typos) - rust-lang#74490 (add a Backtrace::disabled function) - rust-lang#74548 (one more Path::with_extension example, to demonstrate behavior) - rust-lang#74587 (Prefer constant over function) - rust-lang#74606 (Remove Linux workarounds for missing CLOEXEC support) - rust-lang#74637 (Make str point to primitive page) - rust-lang#74654 (require type defaults to be after const generic parameters) - rust-lang#74659 (Improve codegen for unchecked float casts on wasm) Failed merges: r? @ghost
Rust itself has updated its minimum supported versison to 2.6.32 [here](rust-lang/rust#74606). Fixes#85.
Rust itself has updated its minimum supported versison to 2.6.32 [here](rust-lang/rust#74606). Fixes#85.
Rust itself has updated its minimum supported versison to 2.6.32 [here](rust-lang/rust#74606). Fixes#85.
Now that #74163 updated the minimum Linux kernel to 2.6.32, we can
assume the availability of APIs that open file descriptors that are
already set to close on exec, including the flags
O_CLOEXEC,SOCK_CLOEXEC, andF_DUPFD_CLOEXEC.Closes#74519.