Is a bracket-like construct for signal handlers possible?
- Dominant language
- Haskell
- Stars
- 124
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to be a good Unix citizen and restore the signal handlers to the way they were before I meddled with them. Without necessarily ending the process. But all I found that could be used to that effect is `installHandler`; and while it does provide the former handler, I'm at a loss as to what to restore `iset` to.
```Haskell
installHandler :: Signal -> Handler -> Maybe SignalSet -> IO Handler
installHandler int handler iset = oldhandler
```
Peeking at the `sigaction(3)` manpage made matters worse :-) as there's seemingly an additional `sa_flags` bitset that ought to be restored as well and doesn't appear to be exposed by the current API.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.