nix
nix copied to clipboard
Provide safe sigaction functions for setting SIG_IGN and SIG_DFL
#101 made sigaction unsafe because of soundness issues for thread-local storage. It's unfortunate that the really common use case of setting signals to default or ignore now requires unsafe.
Could it be an idea to let sigaction stay as it is, and provide a sigaction_safe or named down the same line that prohibits the use of user-specified functions.
This could allow users to write sigaction_safe(Signal::SIGCHLD, SigHandler:SigIgn) and sigaction_safe(Signal::SIGCHLD, SigHandler:SigDfl)
Or would it be beneficial to not do this only at the sigaction function, but also at the creation of the SigAction struct?
I've added a proposal to do this in #2191.
(This is also loosely related to my proposed changes to query the current signal action in #2190.)