Signals
Signals are like software interrupts: they can be delivered to your program at any time due to a number of well-defined conditions, like when you write outside of your mapped memory pages, you will get sent a SIGBUS (bus error) or a SIGSEGV (segmentation violation) signal. If a subprocess of yours terminates, you will get a SIGCHLD (child stopped) signal. If your controlling terminal goes away, there is SIGHUP (terminal hung up), and if you use the alarm() function, you will get sent SIGALRM when the time expires. The system defines about 31 different signals, many of which deal with job control or specific hardware issues.
A signal is delivered to your program asynchronously whenever it enters the operating system, whether it be via ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access