From 0b8bae2092bf8f67cb19f662664df27f7b767a64 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 5 Feb 2026 12:09:40 +0100 Subject: [PATCH] Fix RLCT_SIGNAL_MASK off-by-one. --- src/header/signal/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/header/signal/mod.rs b/src/header/signal/mod.rs index db7d03da24..e0309b90c0 100644 --- a/src/header/signal/mod.rs +++ b/src/header/signal/mod.rs @@ -387,9 +387,13 @@ pub unsafe extern "C" fn sigpending(set: *mut sigset_t) -> c_int { .or_minus_one_errno() } -const BELOW_SIGRTMIN_MASK: sigset_t = (1 << SIGRTMIN) - 1; -const STANDARD_SIG_MASK: sigset_t = (1 << 32) - 1; -const RLCT_SIGNAL_MASK: sigset_t = BELOW_SIGRTMIN_MASK & !STANDARD_SIG_MASK; +// TODO: Double-check this mask. +// This prevents the application from blocking the two signals SIGRTMIN - 1 and SIGRTMIN - 2 which +// are (at least meant to be) used internally for timers and pthread cancellation. On Linux this is +// 32 and 33 (same as NPTL reserves), whereas this on Redox is 33 and 34 (TODO: could this be +// changed to 32 and 33 for Redox too, since there's currently no support for "sigqueue" targeting +// specific threads). +const RLCT_SIGNAL_MASK: sigset_t = (1 << ((SIGRTMIN - 1) - 1)) | (1 << (SIGRTMIN - 2) - 1); /// See . #[unsafe(no_mangle)]