| 1 |
signal: Unix signal handling and dispatching |
| 2 |
|
| 3 |
The signal module provides support for Unix signal handlers. Typical |
| 4 |
applications will provide a signal handler to [[handle]] to configure it for the |
| 5 |
desired signal, possibly along with flags and a signal mask. This function |
| 6 |
returns the previous signal handler, which can be passed to [[restore]] to |
| 7 |
restore the previous behavior. |
| 8 |
|
| 9 |
Signal handling is stupidly complicated and easy to get wrong. The standard |
| 10 |
library makes little effort to help you deal with this. Consult your local man |
| 11 |
pages, particularly signal-safety(7) on Linux, and perhaps a local priest as |
| 12 |
well. We advise you to get out of the signal handler as soon as possible, for |
| 13 |
example via the "self-pipe trick". |
| 14 |
|
| 15 |
Note that the necessary sa_restorer functionality is implemented (and imposed) |
| 16 |
by the standard library. |