1SIGNAL(7) Linux Programmer's Manual SIGNAL(7)
2
3
4
6 signal - list of available signals
7
9 Linux supports both POSIX reliable signals (hereinafter "standard sig‐
10 nals") and POSIX real-time signals.
11
12 Signal Dispositions
13 Each signal has a current disposition, which determines how the process
14 behaves when it is delivered the signal.
15
16 The entries in the "Action" column of the tables below specify the
17 default disposition for each signal, as follows:
18
19 Term Default action is to terminate the process.
20
21 Ign Default action is to ignore the signal.
22
23 Core Default action is to terminate the process and dump core (see
24 core(5)).
25
26 Stop Default action is to stop the process.
27
28 Cont Default action is to continue the process if it is currently
29 stopped.
30
31 A process can change the disposition of a signal using sigaction(2) or
32 (less portably) signal(2). Using these system calls, a process can
33 elect one of the following behaviours to occur on delivery of the sig‐
34 nal: perform the default action; ignore the signal; or catch the signal
35 with a signal handler, a programmer-defined function that is automati‐
36 cally invoked when the signal is delivered.
37
38 The signal disposition is a per-process attribute: in a multithreaded
39 application, the disposition of a particular signal is the same for all
40 threads.
41
42 Signal Mask and Pending Signals
43 A signal may be blocked, which means that it will not be delivered
44 until it is later unblocked. Between the time when it is generated and
45 when it is delivered a signal is said to be pending.
46
47 Each thread in a process has an independent signal mask, which indi‐
48 cates the set of signals that the thread is currently blocking. A
49 thread can manipulate its signal mask using pthread_sigmask(3). In a
50 traditional single-threaded application, sigprocmask(2) can be used to
51 manipulate the signal mask.
52
53 A signal may be generated (and thus pending) for a process as a whole
54 (e.g., when sent using kill(2)) or for a specific thread (e.g., certain
55 signals, such as SIGSEGV and SIGFPE, generated as a consequence of exe‐
56 cuting a specific machine-language instruction are thread directed, as
57 are signals targeted at a specific thread using pthread_kill(2)). A
58 process-directed signal may be delivered to any one of the threads that
59 does not currently have the signal blocked. If more than one of the
60 threads has the signal unblocked, then the kernel chooses an arbitrary
61 thread to which to deliver the signal.
62
63 A thread can obtain the set of signals that it currently has pending
64 using sigpending(2). This set will consist of the union of the set of
65 pending process-directed signals and the set of signals pending for the
66 calling thread.
67
68 Standard Signals
69 Linux supports the standard signals listed below. Several signal num‐
70 bers are architecture dependent, as indicated in the "Value" column.
71 (Where three values are given, the first one is usually valid for alpha
72 and sparc, the middle one for i386, ppc and sh, and the last one for
73 mips. A - denotes that a signal is absent on the corresponding archi‐
74 tecture.)
75
76 First the signals described in the original POSIX.1-1990 standard.
77
78 Signal Value Action Comment
79 ─────────────────────────────────────────────────────────────────────────
80 SIGHUP 1 Term Hangup detected on controlling terminal
81 or death of controlling process
82 SIGINT 2 Term Interrupt from keyboard
83 SIGQUIT 3 Core Quit from keyboard
84 SIGILL 4 Core Illegal Instruction
85 SIGABRT 6 Core Abort signal from abort(3)
86 SIGFPE 8 Core Floating point exception
87 SIGKILL 9 Term Kill signal
88 SIGSEGV 11 Core Invalid memory reference
89 SIGPIPE 13 Term Broken pipe: write to pipe with no readers
90 SIGALRM 14 Term Timer signal from alarm(2)
91 SIGTERM 15 Term Termination signal
92 SIGUSR1 30,10,16 Term User-defined signal 1
93 SIGUSR2 31,12,17 Term User-defined signal 2
94 SIGCHLD 20,17,18 Ign Child stopped or terminated
95 SIGCONT 19,18,25 Cont Continue if stopped
96 SIGSTOP 17,19,23 Stop Stop process
97 SIGTSTP 18,20,24 Stop Stop typed at tty
98 SIGTTIN 21,21,26 Stop tty input for background process
99 SIGTTOU 22,22,27 Stop tty output for background process
100
101 The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.
102
103 Next the signals not in the POSIX.1-1990 standard but described in
104 SUSv2 and POSIX.1-2001.
105
106 Signal Value Action Comment
107 ─────────────────────────────────────────────────────────────────────────
108 SIGBUS 10,7,10 Core Bus error (bad memory access)
109 SIGPOLL Term Pollable event (Sys V). Synonym of SIGIO
110 SIGPROF 27,27,29 Term Profiling timer expired
111 SIGSYS 12,-,12 Core Bad argument to routine (SVr4)
112 SIGTRAP 5 Core Trace/breakpoint trap
113 SIGURG 16,23,21 Ign Urgent condition on socket (4.2BSD)
114 SIGVTALRM 26,26,28 Term Virtual alarm clock (4.2BSD)
115 SIGXCPU 24,24,30 Core CPU time limit exceeded (4.2BSD)
116 SIGXFSZ 25,25,31 Core File size limit exceeded (4.2BSD)
117
118 Up to and including Linux 2.2, the default behaviour for SIGSYS, SIGX‐
119 CPU, SIGXFSZ, and (on architectures other than SPARC and MIPS) SIGBUS
120 was to terminate the process (without a core dump). (On some other
121 Unix systems the default action for SIGXCPU and SIGXFSZ is to terminate
122 the process without a core dump.) Linux 2.4 conforms to the
123 POSIX.1-2001 requirements for these signals, terminating the process
124 with a core dump.
125
126 Next various other signals.
127
128 Signal Value Action Comment
129 ────────────────────────────────────────────────────────────────────
130 SIGIOT 6 Core IOT trap. A synonym for SIGABRT
131 SIGEMT 7,-,7 Term
132
133 SIGSTKFLT -,16,- Term Stack fault on coprocessor (unused)
134 SIGIO 23,29,22 Term I/O now possible (4.2BSD)
135 SIGCLD -,-,18 Ign A synonym for SIGCHLD
136 SIGPWR 29,30,19 Term Power failure (System V)
137 SIGINFO 29,-,- A synonym for SIGPWR
138 SIGLOST -,-,- Term File lock lost
139 SIGWINCH 28,28,20 Ign Window resize signal (4.3BSD, Sun)
140 SIGUNUSED -,31,- Term Unused signal (will be SIGSYS)
141
142 (Signal 29 is SIGINFO / SIGPWR on an alpha but SIGLOST on a sparc.)
143
144 SIGEMT is not specified in POSIX.1-2001, but nevertheless appears on
145 most other Unix systems, where its default action is typically to ter‐
146 minate the process with a core dump.
147
148 SIGPWR (which is not specified in POSIX.1-2001) is typically ignored by
149 default on those other Unix systems where it appears.
150
151 SIGIO (which is not specified in POSIX.1-2001) is ignored by default on
152 several other Unix systems.
153
154 Real-time Signals
155 Linux supports real-time signals as originally defined in the POSIX.1b
156 real-time extensions (and now included in POSIX.1-2001). Linux sup‐
157 ports 32 real-time signals, numbered from 32 (SIGRTMIN) to 63 (SIGRT‐
158 MAX). (Programs should always refer to real-time signals using nota‐
159 tion SIGRTMIN+n, since the range of real-time signal numbers varies
160 across Unix systems.)
161
162 Unlike standard signals, real-time signals have no predefined meanings:
163 the entire set of real-time signals can be used for application-defined
164 purposes. (Note, however, that the LinuxThreads implementation uses
165 the first three real-time signals.)
166
167 The default action for an unhandled real-time signal is to terminate
168 the receiving process.
169
170 Real-time signals are distinguished by the following:
171
172 1. Multiple instances of real-time signals can be queued. By con‐
173 trast, if multiple instances of a standard signal are delivered
174 while that signal is currently blocked, then only one instance is
175 queued.
176
177 2. If the signal is sent using sigqueue(2), an accompanying value
178 (either an integer or a pointer) can be sent with the signal. If
179 the receiving process establishes a handler for this signal using
180 the SA_SIGINFO flag to sigaction(2) then it can obtain this data
181 via the si_value field of the siginfo_t structure passed as the
182 second argument to the handler. Furthermore, the si_pid and si_uid
183 fields of this structure can be used to obtain the PID and real
184 user ID of the process sending the signal.
185
186 3. Real-time signals are delivered in a guaranteed order. Multiple
187 real-time signals of the same type are delivered in the order they
188 were sent. If different real-time signals are sent to a process,
189 they are delivered starting with the lowest-numbered signal.
190 (I.e., low-numbered signals have highest priority.)
191
192 If both standard and real-time signals are pending for a process, POSIX
193 leaves it unspecified which is delivered first. Linux, like many other
194 implementations, gives priority to standard signals in this case.
195
196 According to POSIX, an implementation should permit at least
197 _POSIX_SIGQUEUE_MAX (32) real-time signals to be queued to a process.
198 However, Linux does things differently. In kernels up to and including
199 2.6.7, Linux imposes a system-wide limit on the number of queued real-
200 time signals for all processes. This limit can be viewed and (with
201 privilege) changed via the /proc/sys/kernel/rtsig-max file. A related
202 file, /proc/sys/kernel/rtsig-nr, can be used to find out how many real-
203 time signals are currently queued. In Linux 2.6.8, these /proc inter‐
204 faces were replaced by the RLIMIT_SIGPENDING resource limit, which
205 specifies a per-user limit for queued signals; see setrlimit(2) for
206 further details.
207
209 POSIX.1
210
212 SIGIO and SIGLOST have the same value. The latter is commented out in
213 the kernel source, but the build process of some software still thinks
214 that signal 29 is SIGLOST.
215
217 kill(1), kill(2), killpg(2), setitimer(2), setrlimit(2), sigaction(2),
218 signal(2), sigpending(2), sigprocmask(2), sigqueue(2), sigsuspend(2),
219 sigwaitinfo(2), raise(3), sigvec(3), sigset(3), strsignal(3), core(5),
220 proc(5), pthreads(7)
221
222
223
224Linux 2.4.18 2002-06-13 SIGNAL(7)