Linux Signals Reference

A common concept of Linux systems programming is the idea of sending and receiving signals. You can think of a signal as a software interrupt that’s used to announce some sort of event, asynchronously, to a process.

We do not define our own signals. Instead, they are defined by the kernel. Each signal has a number, but they also have a name that begins with SIG. We typically refer to a single by its name rather than its number.

As an example, signal 11 is called SIGSEGV and is the signal that is sent to a process when it experiences a segmentation fault.

The Standard Linux Signals

The first 31 signals are standardized on Linux. Some of these are from the POSIX standard, but not all of them.

#Signal NameDefault ActionDescriptionFrom POSIX?
1SIGHUPTerminateHistorically, indicates that a terminal connection has been "hung up". May be used differently on modern systemsYes
2SIGINTTerminateIndicates an interrupt from the keyboard, such as issuing Ctrl-C.Yes
3SIGQUITDumpIndicates that the receiving process should be terminated and a core dump generated (if enabled). Triggered by Ctrl-\ on most terminals.Yes
4SIGILLDumpIndicates an illegal instruction.Yes
5SIGTRAPDumpIndicates that a debugging breakpoint was hit.No
6SIGABRTDumpIndicates an abnormal termination.Yes
6SIGIOTDumpFunctionally equivalent to SIGABRT.No
7SIGBUSDumpIndicates a bus error.No
8SIGFPEDumpIndicates a floating-point exception.Yes
9SIGKILLTerminateIndicates that the process has been force terminated.Yes
10SIGUSR1TerminateNo pre-defined meaning. Available for the process to use.Yes
11SIGSEGVDumpIndicates an invalid memory reference (segfault).Yes
12SIGUSR2TerminateSimilar to SIGUSR1, has no pre-defined meaning. Available for the process to use.Yes
13SIGPIPETerminateIndicates that the process attempted to write to a pipe or socket that has been closed by the reader.Yes
14SIGALRMTerminateSent by the kernel when a timer set by the alarm() syscall expires. Used to implement timeouts and periodic actions in programs.Yes
15SIGTERMTerminateIndicates process termination.Yes
16SIGSTKFLTTerminateIndicates a stack error from a coprocessor.No
17SIGCHLDIgnoreIndicates that a child process has stopped, been terminated, or continued after being stopped.Yes
18SIGCONTContinueResume execution, if stopped.Yes
19SIGSTOPStopIndicates that a process should stop execution. Triggered by Ctrl-Z on most terminals.Yes
20SIGTSTPStopStop process issued from a TTY.Yes
21SIGTTINStopIndicates that a background process requires input.Yes
22SIGTTOUStopIndicates that a background process requires output.Yes
23SIGURGIgnoreIndicates that there is an urgent condition on a socket.No
24SIGXCPUDumpIndicates that a CPU time limit has been exceeded.No
25SIGXFSZDumpSent when a process attempts to write beyond the maximum file size limit.No
26SIGVTALRMTerminateIndicates that a process has consumed a certain amount of CPU time. Unlike SIGALRM (which uses the real/wall-clock time), SIGVTALRM tracks the time that the process has been executing on the CPU. It only counts the time when the process is running.No
27SIGPROGTerminateSent when the profiling timer expires.No
28SIGWINCHIgnoreSent when the process's controlling terminal window changes size.No
29SIGIOTerminateIndicates that I/O is now possible.No
29SIGPOLLTerminateFunctionally equivalent to SIGIO. SIGPOLL and SIGIO are actually the same signal.No
30SIGPWRTerminateIndicates a power supply failure.No
31SIGSYSDumpIndicates a bad system call.No

What Happens When a Signal is Sent?

When the kernel sends a signal to a process, it must be handled. There are three possible ways to do this: