A signal handler is a function invoked when a signal interrupts ordinary execution. Signals can reflect a fault caused by the current instruction, such as division by zero, or an asynchronous event, such as a termination request. C provides a portable abstraction for both kinds of interrupt. section 19.6
Registering a handler
The interface includes `signal(int, sh_handler*)` to establish a handler and `raise(int)` to raise a signal. For example, a program can register a handler for `SIGINT`, an interactive attention signal. The handler receives the signal number, allowing it to record which condition occurred. section 19.6
TAKEAWAY: Keep the handler small. Record the interrupt condition in a global flag, return to the interrupted context, and do the substantive work there. Communication with a handler is limited to `volatile sig_atomic_t`, `atomic_flag`, or other lock-free atomic types. section 19.7
Figure 19.3 Control flow after an interrupt return jumps to the position where the interrupt occurred
The control-flow diagram shows execution returning to the position where an interrupt occurred. section 19.6



