SIGINT
Interrupt from the keyboard (Ctrl-C).
- Linux number
- 2
- FreeBSD number
- 2
- Default action
- Terminate the process
- Catch, block or ignore
- Allowed
- Standard
- POSIX.1-1990
The terminal driver sends it to the whole foreground process group, not to one process. A well-behaved program cleans up and then re-raises SIGINT against itself with the default handler restored, so the parent shell sees "killed by signal 2" rather than a plain exit.
Compare it
- SIGINT vs SIGQUIT · What is the difference between Ctrl-C and Ctrl-\?
Rod on this
Sources
Numbers are Linux on x86 and arm64; alpha, mips, sparc and parisc number some signals differently. Spot one that's wrong? Tell Rod.