Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide safe sigaction functions for setting SIG_IGN and SIG_DFL #587

Open
kamalmarhubi opened this issue Apr 17, 2017 · 2 comments · May be fixed by #2191
Open

Provide safe sigaction functions for setting SIG_IGN and SIG_DFL #587

kamalmarhubi opened this issue Apr 17, 2017 · 2 comments · May be fixed by #2191

Comments

@kamalmarhubi
Copy link
Member

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

@NikolaiMagnussen
Copy link

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?

cpick pushed a commit to cpick/nix that referenced this issue Nov 14, 2023
Provide safe mechanisms to ignore or reset a signal's action to the
default.

Fixes nix-rust#587.
@cpick cpick linked a pull request Nov 14, 2023 that will close this issue
3 tasks
@cpick
Copy link

cpick commented Nov 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants