haskell / haskell/unix

Is a bracket-like construct for signal handlers possible?

Open
#149 2 comments 0 reactions 0 assignees View on GitHub
status: info-needed type: enhancement
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.