-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
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 has picked a reviewer for you, use r? to override) |
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this note about android not relevant anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unfortunate, but probably cleaner than trying to figure out the exact cfg needed.
@bors r+ |
📌 Commit ae06e13 has been approved by |
🌲 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.
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.