uucore: handle SIGRTMIN+N and SIGRTMAX-N notation#12149
Conversation
|
GNU testsuite comparison: |
|
some jobs are failing |
|
This is actually not enough to fix #11151 yet. The parsing is fixed, but the signals are not actually blocked, because |
9bbd658 to
c938b58
Compare
|
With the two additional commits, env and kill should both properly support real-time signals. |
9f8b1f2 to
3af4e8c
Compare
|
I think the remaining CI failure is unrelated. |
de761af to
cad60c0
Compare
| } | ||
| } | ||
|
|
||
| #[cfg(unix)] |
There was a problem hiding this comment.
please move it back where it was. it decreases the diff size
| fn block_signal(sig: usize) -> UResult<()> { | ||
| // nix::sys::signal::Signal does not cover real time signals, so we need to build | ||
| // sigset_t manually using libc. | ||
| let set = unsafe { |
There was a problem hiding this comment.
can you do that in a function ?
Merging this PR will not alter performance
Comparing Footnotes
|
|
I dropped the kill changes because that appears to be fixed by #12326, but I kept the new tests. |
|
@sylvestre The remaining CI failures look unrelated. Can you please take another look? |
On Linux, signals in the range SIGRTMIN..SIGRTMAX are valid in addition to SIGRTMIN and SIGRTMAX themselves. The notation SIGRTMIN+N and SIGRTMAX-N is used to reference signals in that range. Adapt signal helpers to understand this.
The nix::sys::signal::Signal enum type does not cover real-time signals. In the current env code, this means that trying to block e.g. SIGRTMIN+7 is silently ignored, apply_signal_action() silently drops signals that cannot be represented as that enum. However, the enum cannot simply be extended to represent the real-time signals, because SIGRTMIN and SIGRTMAX cannot be considered constants. To workaround this, do not use the Signal enum type, and use libc where needed instead of the wrappers. Fixes: uutils#11151
198ae14 to
4721a03
Compare
On Linux, signals in the range SIGRTMIN..SIGRTMAX are valid in addition to SIGRTMIN and SIGRTMAX themselves. The notation SIGRTMIN+N and SIGRTMAX-N is used to reference signals in that range.
Adapt signal helpers to understand this.
Fixes: #11151