nix icon indicating copy to clipboard operation
nix copied to clipboard

Provide safe sigaction functions for setting SIG_IGN and SIG_DFL

Open kamalmarhubi opened this issue 8 years ago • 2 comments
trafficstars

#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.

kamalmarhubi avatar Apr 17 '17 03:04 kamalmarhubi

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?

NikolaiMagnussen avatar May 05 '18 13:05 NikolaiMagnussen

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.)

cpick avatar Nov 14 '23 01:11 cpick