env: support real-time signals and drop the nix dependency #13006
Open
sylvestre wants to merge 3 commits into
Open
env: support real-time signals and drop the nix dependency #13006sylvestre wants to merge 3 commits into
sylvestre wants to merge 3 commits into
Conversation
|
GNU testsuite comparison: |
Use rustix for process/signal handling (and libc directly where rustix leaves signal disposition to libc), and add real-time signal support, which nix's Signal enum can't represent. Shared signal_from_raw() and set_disposition() helpers are reused by env. Drops nix's "poll" feature.
Use uucore::signals helpers (and libc::sigprocmask) so real-time signals work like any other, and print their names in --list-signal-handling instead of "?". env now execs via libc::execvp directly and drops nix.
cakebaker
reviewed
Jun 22, 2026
Comment on lines
+490
to
+495
| if let Some((rtmin, rtmax)) = realtime_signal_bounds() { | ||
| if (rtmin..=rtmax).contains(&(raw as usize)) { | ||
| return Some(raw); | ||
| } | ||
| } | ||
| None |
Contributor
There was a problem hiding this comment.
A functional approach might be cleaner. And instead of casting raw as usize you can use signal as it is already usize. Something like:
Suggested change
| if let Some((rtmin, rtmax)) = realtime_signal_bounds() { | |
| if (rtmin..=rtmax).contains(&(raw as usize)) { | |
| return Some(raw); | |
| } | |
| } | |
| None | |
| realtime_signal_bounds().and_then(|(rtmin, rtmax)| { | |
| (rtmin..=rtmax).contains(&signal).then_some(raw) | |
| }) |
oech3
reviewed
Jun 24, 2026
| /// `geteuid()` returns the effective user ID of the calling process. | ||
| pub fn geteuid() -> uid_t { | ||
| nix::unistd::geteuid().as_raw() | ||
| rustix::process::geteuid().as_raw() |
Contributor
There was a problem hiding this comment.
I'd like to remove them instead of changing.
https://github.com/uutils/coreutils/pull/11158/changes#diff-d46528f20f5f4736449232dca566e761ee26c460fb5f125fae935bc4dcbdd518
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
should fix env/env-signal-handler.sh