Part 1 of 6 · 1 min read
Why this page comes sixth
In this module you will
- Say what a signal is and name the common ones with their numbers.
- Install a handler with
sigactionand send a signal withkill. - Explain which signals cannot be caught or ignored, and why.
- Read from a wait status how a process was killed.
- Explain why a handler must do very little.
Level 0, page 5 said that a signal is the software relative of an interrupt. Page 3 of this level used signal numbers to read why a child ended, and page 4 asked the shell to print them. This page explains where those numbers come from and how a program reacts. Page 7 uses one signal, SIGPIPE, to end pipelines, and page 8 uses SIGCHLD to clean up children. The main sources are "The Linux Programming Interface" (TLPI), chapters 20 to 22, "Operating Systems: Three Easy Pieces" (OSTEP), chapter 5, and "Operating System Concepts" (OSC), chapter 4. All programs were compiled with -Wall -Wextra and run on Linux.
About this example About this example
Real: The C programs, commands and outputs on this page were compiled with gcc -Wall -Wextra -pthread and run on a Linux test machine (2 processors, kernel 6.18, glibc 2.39).
Scripted: The worked traces use small numbers chosen so they can be followed by hand.
Not real: The page simplifies real systems. Actual kernels add more cases, limits and tuning than a short page can show.