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