]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) |
f527d6fe | 2 | .\" and Copyright (c) 2002, 2006, 2020 by Michael Kerrisk <mtk.manpages@gmail.com> |
743bc395 MK |
3 | .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk |
4 | .\" <mtk.manpages@gmail.com> | |
fea681da | 5 | .\" |
5fbde956 | 6 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
1b88e9c2 | 7 | .\" |
fea681da MK |
8 | .\" Modified Sat Jul 24 17:34:08 1993 by Rik Faith (faith@cs.unc.edu) |
9 | .\" Modified Sun Jan 7 01:41:27 1996 by Andries Brouwer (aeb@cwi.nl) | |
10 | .\" Modified Sun Apr 14 12:02:29 1996 by Andries Brouwer (aeb@cwi.nl) | |
11 | .\" Modified Sat Nov 13 16:28:23 1999 by Andries Brouwer (aeb@cwi.nl) | |
c11b1abf MK |
12 | .\" Modified 10 Apr 2002, by Michael Kerrisk <mtk.manpages@gmail.com> |
13 | .\" Modified 7 Jun 2002, by Michael Kerrisk <mtk.manpages@gmail.com> | |
fea681da | 14 | .\" Added information on real-time signals |
c11b1abf | 15 | .\" Modified 13 Jun 2002, by Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 16 | .\" Noted that SIGSTKFLT is in fact unused |
1c1634c0 | 17 | .\" 2004-12-03, Modified mtk, added notes on RLIMIT_SIGPENDING |
ae74cd0d MK |
18 | .\" 2006-04-24, mtk, Added text on changing signal dispositions, |
19 | .\" signal mask, and pending signals. | |
743bc395 MK |
20 | .\" 2008-07-04, mtk: |
21 | .\" Added section on system call restarting (SA_RESTART) | |
22 | .\" Added section on stop/cont signals interrupting syscalls. | |
2411effe | 23 | .\" 2008-10-05, mtk: various additions |
fea681da | 24 | .\" |
4c1c5274 | 25 | .TH signal 7 (date) "Linux man-pages (unreleased)" |
fea681da | 26 | .SH NAME |
2411effe | 27 | signal \- overview of signals |
fea681da MK |
28 | .SH DESCRIPTION |
29 | Linux supports both POSIX reliable signals (hereinafter | |
30 | "standard signals") and POSIX real-time signals. | |
73d8cece | 31 | .SS Signal dispositions |
c13182ef | 32 | Each signal has a current |
ae74cd0d | 33 | .IR disposition , |
c13182ef | 34 | which determines how the process behaves when it is delivered |
ae74cd0d | 35 | the signal. |
a721e8b2 | 36 | .PP |
1fa9fdb1 | 37 | The entries in the "Action" column of the table below specify |
ae74cd0d | 38 | the default disposition for each signal, as follows: |
4279e42d AC |
39 | .TP |
40 | Term | |
fea681da | 41 | Default action is to terminate the process. |
4279e42d AC |
42 | .TP |
43 | Ign | |
fea681da | 44 | Default action is to ignore the signal. |
4279e42d AC |
45 | .TP |
46 | Core | |
ae74cd0d MK |
47 | Default action is to terminate the process and dump core (see |
48 | .BR core (5)). | |
4279e42d AC |
49 | .TP |
50 | Stop | |
fea681da | 51 | Default action is to stop the process. |
4279e42d AC |
52 | .TP |
53 | Cont | |
ae74cd0d | 54 | Default action is to continue the process if it is currently stopped. |
fea681da | 55 | .PP |
ae74cd0d MK |
56 | A process can change the disposition of a signal using |
57 | .BR sigaction (2) | |
7edfdaca | 58 | or |
ae74cd0d | 59 | .BR signal (2). |
7edfdaca MK |
60 | (The latter is less portable when establishing a signal handler; |
61 | see | |
62 | .BR signal (2) | |
63 | for details.) | |
c13182ef | 64 | Using these system calls, a process can elect one of the |
6beb1671 | 65 | following behaviors to occur on delivery of the signal: |
c13182ef | 66 | perform the default action; ignore the signal; |
ae74cd0d | 67 | or catch the signal with a |
c13182ef MK |
68 | .IR "signal handler" , |
69 | a programmer-defined function that is automatically invoked | |
ae74cd0d | 70 | when the signal is delivered. |
705ac54d MK |
71 | .PP |
72 | By default, a signal handler is invoked on the | |
eeccef1d MK |
73 | normal process stack. |
74 | It is possible to arrange that the signal handler | |
75 | uses an alternate stack; see | |
76 | .BR sigaltstack (2) | |
705ac54d | 77 | for a discussion of how to do this and when it might be useful. |
a721e8b2 | 78 | .PP |
ae74cd0d | 79 | The signal disposition is a per-process attribute: |
c13182ef | 80 | in a multithreaded application, the disposition of a |
ae74cd0d | 81 | particular signal is the same for all threads. |
a721e8b2 | 82 | .PP |
d5c88298 MK |
83 | A child created via |
84 | .BR fork (2) | |
85 | inherits a copy of its parent's signal dispositions. | |
86 | During an | |
87 | .BR execve (2), | |
88 | the dispositions of handled signals are reset to the default; | |
89 | the dispositions of ignored signals are left unchanged. | |
c634028a | 90 | .SS Sending a signal |
7a414038 MK |
91 | The following system calls and library functions allow |
92 | the caller to send a signal: | |
1f11ae8a | 93 | .TP |
7a414038 MK |
94 | .BR raise (3) |
95 | Sends a signal to the calling thread. | |
96 | .TP | |
97 | .BR kill (2) | |
98 | Sends a signal to a specified process, | |
99 | to all members of a specified process group, | |
100 | or to all processes on the system. | |
101 | .TP | |
bdeb6c88 MK |
102 | .BR pidfd_send_signal (2) |
103 | Sends a signal to a process identified by a PID file descriptor. | |
104 | .TP | |
498aad50 | 105 | .BR killpg (3) |
7a414038 MK |
106 | Sends a signal to all of the members of a specified process group. |
107 | .TP | |
108 | .BR pthread_kill (3) | |
109 | Sends a signal to a specified POSIX thread in the same process as | |
110 | the caller. | |
111 | .TP | |
112 | .BR tgkill (2) | |
113 | Sends a signal to a specified thread within a specific process. | |
114 | (This is the system call used to implement | |
115 | .BR pthread_kill (3).) | |
116 | .TP | |
485ab701 | 117 | .BR sigqueue (3) |
7a414038 | 118 | Sends a real-time signal with accompanying data to a specified process. |
c634028a | 119 | .SS Waiting for a signal to be caught |
0cec2472 MK |
120 | The following system calls suspend execution of the calling |
121 | thread until a signal is caught | |
22fe4981 | 122 | (or an unhandled signal terminates the process): |
1f11ae8a | 123 | .TP |
22fe4981 MK |
124 | .BR pause (2) |
125 | Suspends execution until any signal is caught. | |
126 | .TP | |
127 | .BR sigsuspend (2) | |
128 | Temporarily changes the signal mask (see below) and suspends | |
129 | execution until one of the unmasked signals is caught. | |
f527d6fe | 130 | .\" |
c634028a | 131 | .SS Synchronously accepting a signal |
e66d51d1 MK |
132 | Rather than asynchronously catching a signal via a signal handler, |
133 | it is possible to synchronously accept the signal, that is, | |
134 | to block execution until the signal is delivered, | |
135 | at which point the kernel returns information about the | |
136 | signal to the caller. | |
137 | There are two general ways to do this: | |
22356d97 | 138 | .IP \(bu 3 |
e66d51d1 MK |
139 | .BR sigwaitinfo (2), |
140 | .BR sigtimedwait (2), | |
141 | and | |
142 | .BR sigwait (3) | |
143 | suspend execution until one of the signals in a specified | |
144 | set is delivered. | |
145 | Each of these calls returns information about the delivered signal. | |
22356d97 | 146 | .IP \(bu |
e66d51d1 MK |
147 | .BR signalfd (2) |
148 | returns a file descriptor that can be used to read information | |
149 | about signals that are delivered to the caller. | |
150 | Each | |
151 | .BR read (2) | |
152 | from this file descriptor blocks until one of the signals | |
153 | in the set specified in the | |
154 | .BR signalfd (2) | |
155 | call is delivered to the caller. | |
156 | The buffer returned by | |
157 | .BR read (2) | |
158 | contains a structure describing the signal. | |
73d8cece | 159 | .SS Signal mask and pending signals |
ae74cd0d MK |
160 | A signal may be |
161 | .IR blocked , | |
162 | which means that it will not be delivered until it is later unblocked. | |
163 | Between the time when it is generated and when it is delivered | |
c13182ef | 164 | a signal is said to be |
ae74cd0d | 165 | .IR pending . |
a721e8b2 | 166 | .PP |
c13182ef MK |
167 | Each thread in a process has an independent |
168 | .IR "signal mask" , | |
ae74cd0d MK |
169 | which indicates the set of signals that the thread is currently blocking. |
170 | A thread can manipulate its signal mask using | |
171 | .BR pthread_sigmask (3). | |
c13182ef | 172 | In a traditional single-threaded application, |
ae74cd0d MK |
173 | .BR sigprocmask (2) |
174 | can be used to manipulate the signal mask. | |
a721e8b2 | 175 | .PP |
d5c88298 MK |
176 | A child created via |
177 | .BR fork (2) | |
178 | inherits a copy of its parent's signal mask; | |
179 | the signal mask is preserved across | |
180 | .BR execve (2). | |
a721e8b2 | 181 | .PP |
3b9d4409 MK |
182 | A signal may be process-directed or thread-directed. |
183 | A process-directed signal is one that is targeted at (and thus pending for) | |
184 | the process as a whole. | |
185 | A signal may be process-directed | |
186 | because it was generated by the kernel for reasons | |
187 | other than a hardware exception, or because it was sent using | |
188 | .BR kill (2) | |
189 | or | |
190 | .BR sigqueue (3). | |
96f49e54 | 191 | A thread-directed signal is one that is targeted at a specific thread. |
3b9d4409 MK |
192 | A signal may be thread-directed because it was generated as a consequence |
193 | of executing a specific machine-language instruction | |
194 | that triggered a hardware exception (e.g., | |
5a5574b9 | 195 | .B SIGSEGV |
3b9d4409 MK |
196 | for an invalid memory access, or |
197 | .B SIGFPE | |
c1d62739 | 198 | for a math error), or because it was |
3b9d4409 MK |
199 | targeted at a specific thread using |
200 | interfaces such as | |
201 | .BR tgkill (2) | |
202 | or | |
203 | .BR pthread_kill (3). | |
204 | .PP | |
ae74cd0d MK |
205 | A process-directed signal may be delivered to any one of the |
206 | threads that does not currently have the signal blocked. | |
3220cf5f MK |
207 | .\" Joseph C. Sible notes: |
208 | .\" On Linux, if the main thread has the signal unblocked, then the kernel | |
209 | .\" will always deliver the signal there, citing this kernel code | |
210 | .\" | |
211 | .\" Per this comment in kernel/signal.c since time immemorial: | |
212 | .\" | |
213 | .\" /* | |
214 | .\" * Now find a thread we can wake up to take the signal off the queue. | |
215 | .\" * | |
216 | .\" * If the main thread wants the signal, it gets first crack. | |
217 | .\" * Probably the least surprising to the average bear. | |
218 | .\" */ | |
219 | .\" | |
220 | .\" But this does not mean the signal will be delivered only in the | |
221 | .\" main thread, since if a handler is already executing in the main thread | |
222 | .\" (and thus the signal is blocked in that thread), then a further | |
223 | .\" might be delivered in a different thread. | |
224 | .\" | |
c13182ef | 225 | If more than one of the threads has the signal unblocked, then the |
ae74cd0d | 226 | kernel chooses an arbitrary thread to which to deliver the signal. |
a721e8b2 | 227 | .PP |
ae74cd0d MK |
228 | A thread can obtain the set of signals that it currently has pending |
229 | using | |
230 | .BR sigpending (2). | |
c13182ef MK |
231 | This set will consist of the union of the set of pending |
232 | process-directed signals and the set of signals pending for | |
ae74cd0d | 233 | the calling thread. |
a721e8b2 | 234 | .PP |
d5c88298 MK |
235 | A child created via |
236 | .BR fork (2) | |
237 | initially has an empty pending signal set; | |
238 | the pending signal set is preserved across an | |
239 | .BR execve (2). | |
4672536d MK |
240 | .\" |
241 | .SS Execution of signal handlers | |
242 | Whenever there is a transition from kernel-mode to user-mode execution | |
243 | (e.g., on return from a system call or scheduling of a thread onto the CPU), | |
42e6553d MK |
244 | the kernel checks whether there is a pending unblocked signal |
245 | for which the process has established a signal handler. | |
4672536d | 246 | If there is such a pending signal, the following steps occur: |
22356d97 | 247 | .IP (1) 5 |
4672536d MK |
248 | The kernel performs the necessary preparatory steps for execution of |
249 | the signal handler: | |
250 | .RS | |
22356d97 | 251 | .IP (1.1) 7 |
4672536d | 252 | The signal is removed from the set of pending signals. |
22356d97 | 253 | .IP (1.2) |
17cf67cc MK |
254 | If the signal handler was installed by a call to |
255 | .BR sigaction (2) | |
256 | that specified the | |
1ae6b2c7 | 257 | .B SA_ONSTACK |
17cf67cc | 258 | flag and the thread has defined an alternate signal stack (using |
4672536d MK |
259 | .BR sigaltstack (2)), |
260 | then that stack is installed. | |
22356d97 | 261 | .IP (1.3) |
4672536d | 262 | Various pieces of signal-related context are saved |
e7a5700f | 263 | into a special frame that is created on the stack. |
4672536d MK |
264 | The saved information includes: |
265 | .RS | |
22356d97 | 266 | .IP \(bu 3 |
4672536d MK |
267 | the program counter register |
268 | (i.e., the address of the next instruction in the main program that | |
269 | should be executed when the signal handler returns); | |
22356d97 | 270 | .IP \(bu |
e7a5700f MK |
271 | architecture-specific register state required for resuming the |
272 | interrupted program; | |
22356d97 | 273 | .IP \(bu |
4672536d | 274 | the thread's current signal mask; |
22356d97 | 275 | .IP \(bu |
4672536d MK |
276 | the thread's alternate signal stack settings. |
277 | .RE | |
6430ba7a MK |
278 | .IP |
279 | (If the signal handler was installed using the | |
280 | .BR sigaction (2) | |
281 | .B SA_SIGINFO | |
282 | flag, then the above information is accessible via the | |
938dd97e MK |
283 | .I ucontext_t |
284 | object that is pointed to by the third argument of the signal handler.) | |
22356d97 | 285 | .IP (1.4) |
e7a5700f MK |
286 | Any signals specified in |
287 | .I act\->sa_mask | |
288 | when registering the handler with | |
289 | .BR sigprocmask (2) | |
290 | are added to the thread's signal mask. | |
291 | The signal being delivered is also | |
292 | added to the signal mask, unless | |
293 | .B SA_NODEFER | |
294 | was specified when registering the handler. | |
4672536d MK |
295 | These signals are thus blocked while the handler executes. |
296 | .RE | |
22356d97 | 297 | .IP (2) |
4672536d | 298 | The kernel constructs a frame for the signal handler on the stack. |
e7a5700f MK |
299 | The kernel sets the program counter for the thread to point to the first |
300 | instruction of the signal handler function, | |
301 | and configures the return address for that function to point to a piece | |
302 | of user-space code known as the signal trampoline (described in | |
4672536d | 303 | .BR sigreturn (2)). |
22356d97 | 304 | .IP (3) |
4672536d MK |
305 | The kernel passes control back to user-space, where execution |
306 | commences at the start of the signal handler function. | |
22356d97 | 307 | .IP (4) |
4672536d | 308 | When the signal handler returns, control passes to the signal trampoline code. |
22356d97 | 309 | .IP (5) |
4672536d MK |
310 | The signal trampoline calls |
311 | .BR sigreturn (2), | |
e7a5700f | 312 | a system call that uses the information in the stack frame created in step 1 |
42e6553d MK |
313 | to restore the thread to its state before the signal handler was |
314 | called. | |
315 | The thread's signal mask and alternate signal stack settings | |
316 | are restored as part of this procedure. | |
4672536d MK |
317 | Upon completion of the call to |
318 | .BR sigreturn (2), | |
319 | the kernel transfers control back to user space, | |
320 | and the thread recommences execution at the point where it was | |
321 | interrupted by the signal handler. | |
322 | .PP | |
323 | Note that if the signal handler does not return | |
324 | (e.g., control is transferred out of the handler using | |
e066dcb3 | 325 | .BR siglongjmp (3), |
4672536d MK |
326 | or the handler executes a new program with |
327 | .BR execve (2)), | |
328 | then the final step is not performed. | |
329 | In particular, in such scenarios it is the programmer's responsibility | |
17cf67cc MK |
330 | to restore the state of the signal mask (using |
331 | .BR sigprocmask (2)), | |
332 | if it is desired to unblock the signals that were blocked on entry | |
4672536d | 333 | to the signal handler. |
17cf67cc MK |
334 | (Note that |
335 | .BR siglongjmp (3) | |
336 | may or may not restore the signal mask, depending on the | |
337 | .I savesigs | |
338 | value that was specified in the corresponding call to | |
339 | .BR sigsetjmp (3).) | |
42e6553d MK |
340 | .PP |
341 | From the kernel's point of view, | |
342 | execution of the signal handler code is exactly the same as the execution | |
343 | of any other user-space code. | |
344 | That is to say, the kernel does not record any special state information | |
0580884c | 345 | indicating that the thread is currently executing inside a signal handler. |
42e6553d MK |
346 | All necessary state information is maintained in user-space registers |
347 | and the user-space stack. | |
348 | The depth to which nested signal handlers may be invoked is thus | |
349 | limited only by the user-space stack (and sensible software design!). | |
4672536d | 350 | .\" |
73d8cece | 351 | .SS Standard signals |
c13182ef | 352 | Linux supports the standard signals listed below. |
1fa9fdb1 MK |
353 | The second column of the table indicates which standard (if any) |
354 | specified the signal: "P1990" indicates that the signal is described | |
355 | in the original POSIX.1-1990 standard; | |
356 | "P2001" indicates that the signal was added in SUSv2 and POSIX.1-2001. | |
fea681da MK |
357 | .TS |
358 | l c c l | |
359 | ____ | |
360 | lB c c l. | |
6043ed9d | 361 | Signal Standard Action Comment |
1fa9fdb1 MK |
362 | SIGABRT P1990 Core Abort signal from \fBabort\fP(3) |
363 | SIGALRM P1990 Term Timer signal from \fBalarm\fP(2) | |
364 | SIGBUS P2001 Core Bus error (bad memory access) | |
365 | SIGCHLD P1990 Ign Child stopped or terminated | |
366 | SIGCLD \- Ign A synonym for \fBSIGCHLD\fP | |
367 | SIGCONT P1990 Cont Continue if stopped | |
368 | SIGEMT \- Term Emulator trap | |
369 | SIGFPE P1990 Core Floating-point exception | |
6043ed9d | 370 | SIGHUP P1990 Term Hangup detected on controlling terminal |
fea681da | 371 | or death of controlling process |
6043ed9d | 372 | SIGILL P1990 Core Illegal Instruction |
1fa9fdb1 MK |
373 | SIGINFO \- A synonym for \fBSIGPWR\fP |
374 | SIGINT P1990 Term Interrupt from keyboard | |
375 | SIGIO \- Term I/O now possible (4.2BSD) | |
376 | SIGIOT \- Core IOT trap. A synonym for \fBSIGABRT\fP | |
6043ed9d | 377 | SIGKILL P1990 Term Kill signal |
1fa9fdb1 | 378 | SIGLOST \- Term File lock lost (unused) |
6043ed9d | 379 | SIGPIPE P1990 Term Broken pipe: write to pipe with no |
9af4022a | 380 | readers; see \fBpipe\fP(7) |
08a964c9 MK |
381 | SIGPOLL P2001 Term Pollable event (Sys V); |
382 | synonym for \fBSIGIO\fP | |
6043ed9d | 383 | SIGPROF P2001 Term Profiling timer expired |
1fa9fdb1 MK |
384 | SIGPWR \- Term Power failure (System V) |
385 | SIGQUIT P1990 Core Quit from keyboard | |
386 | SIGSEGV P1990 Core Invalid memory reference | |
387 | SIGSTKFLT \- Term Stack fault on coprocessor (unused) | |
388 | SIGSTOP P1990 Stop Stop process | |
389 | SIGTSTP P1990 Stop Stop typed at terminal | |
6043ed9d | 390 | SIGSYS P2001 Core Bad system call (SVr4); |
0288ee4c | 391 | see also \fBseccomp\fP(2) |
1fa9fdb1 | 392 | SIGTERM P1990 Term Termination signal |
6043ed9d | 393 | SIGTRAP P2001 Core Trace/breakpoint trap |
1fa9fdb1 MK |
394 | SIGTTIN P1990 Stop Terminal input for background process |
395 | SIGTTOU P1990 Stop Terminal output for background process | |
396 | SIGUNUSED \- Core Synonymous with \fBSIGSYS\fP | |
6043ed9d | 397 | SIGURG P2001 Ign Urgent condition on socket (4.2BSD) |
1fa9fdb1 MK |
398 | SIGUSR1 P1990 Term User-defined signal 1 |
399 | SIGUSR2 P1990 Term User-defined signal 2 | |
6043ed9d MK |
400 | SIGVTALRM P2001 Term Virtual alarm clock (4.2BSD) |
401 | SIGXCPU P2001 Core CPU time limit exceeded (4.2BSD); | |
eb8e63a9 | 402 | see \fBsetrlimit\fP(2) |
6043ed9d | 403 | SIGXFSZ P2001 Core File size limit exceeded (4.2BSD); |
bd741e0f | 404 | see \fBsetrlimit\fP(2) |
1fa9fdb1 | 405 | SIGWINCH \- Ign Window resize signal (4.3BSD, Sun) |
fea681da | 406 | .TE |
bdbc9b44 | 407 | .PP |
1fa9fdb1 MK |
408 | The signals |
409 | .B SIGKILL | |
410 | and | |
411 | .B SIGSTOP | |
412 | cannot be caught, blocked, or ignored. | |
413 | .PP | |
d9bfdb9c | 414 | Up to and including Linux 2.2, the default behavior for |
c3f60223 | 415 | .BR SIGSYS ", " SIGXCPU ", " SIGXFSZ , |
fea681da MK |
416 | and (on architectures other than SPARC and MIPS) |
417 | .B SIGBUS | |
418 | was to terminate the process (without a core dump). | |
008f1ecc | 419 | (On some other UNIX systems the default action for |
fea681da MK |
420 | .BR SIGXCPU " and " SIGXFSZ |
421 | is to terminate the process without a core dump.) | |
4dec66f9 | 422 | Linux 2.4 conforms to the POSIX.1-2001 requirements for these signals, |
fea681da | 423 | terminating the process with a core dump. |
a721e8b2 | 424 | .PP |
fea681da | 425 | .B SIGEMT |
4dec66f9 | 426 | is not specified in POSIX.1-2001, but nevertheless appears |
008f1ecc | 427 | on most other UNIX systems, |
d24e2319 | 428 | where its default action is typically to terminate |
fea681da | 429 | the process with a core dump. |
a721e8b2 | 430 | .PP |
fea681da | 431 | .B SIGPWR |
4dec66f9 | 432 | (which is not specified in POSIX.1-2001) is typically ignored |
008f1ecc | 433 | by default on those other UNIX systems where it appears. |
a721e8b2 | 434 | .PP |
fea681da | 435 | .B SIGIO |
4dec66f9 | 436 | (which is not specified in POSIX.1-2001) is ignored by default |
008f1ecc | 437 | on several other UNIX systems. |
1fa9fdb1 | 438 | .\" |
c7871135 MK |
439 | .SS Queueing and delivery semantics for standard signals |
440 | If multiple standard signals are pending for a process, | |
441 | the order in which the signals are delivered is unspecified. | |
442 | .PP | |
443 | Standard signals do not queue. | |
444 | If multiple instances of a standard signal are generated while | |
445 | that signal is blocked, | |
446 | then only one instance of the signal is marked as pending | |
447 | (and the signal will be delivered just once when it is unblocked). | |
9b6aa9d1 | 448 | In the case where a standard signal is already pending, the |
cd9b34fc | 449 | .I siginfo_t |
9b6aa9d1 MK |
450 | structure (see |
451 | .BR sigaction (2)) | |
452 | associated with that signal is not overwritten | |
453 | on arrival of subsequent instances of the same signal. | |
454 | Thus, the process will receive the information | |
455 | associated with the first instance of the signal. | |
c7871135 | 456 | .\" |
9a10a144 MK |
457 | .SS Signal numbering for standard signals |
458 | The numeric value for each signal is given in the table below. | |
459 | As shown in the table, many signals have different numeric values | |
460 | on different architectures. | |
461 | The first numeric value in each table row shows the signal number | |
462 | on x86, ARM, and most other architectures; | |
463 | the second value is for Alpha and SPARC; the third is for MIPS; | |
464 | and the last is for PARISC. | |
465 | A dash (\-) denotes that a signal is absent on the corresponding architecture. | |
466 | .TS | |
467 | l c c c c l | |
468 | l c c c c l | |
469 | ______ | |
470 | lB c c c c l. | |
471 | Signal x86/ARM Alpha/ MIPS PARISC Notes | |
472 | most others SPARC | |
473 | SIGHUP \01 \01 \01 \01 | |
474 | SIGINT \02 \02 \02 \02 | |
475 | SIGQUIT \03 \03 \03 \03 | |
476 | SIGILL \04 \04 \04 \04 | |
477 | SIGTRAP \05 \05 \05 \05 | |
478 | SIGABRT \06 \06 \06 \06 | |
479 | SIGIOT \06 \06 \06 \06 | |
480 | SIGBUS \07 10 10 10 | |
481 | SIGEMT \- \07 \07 - | |
482 | SIGFPE \08 \08 \08 \08 | |
483 | SIGKILL \09 \09 \09 \09 | |
484 | SIGUSR1 10 30 16 16 | |
485 | SIGSEGV 11 11 11 11 | |
486 | SIGUSR2 12 31 17 17 | |
487 | SIGPIPE 13 13 13 13 | |
488 | SIGALRM 14 14 14 14 | |
489 | SIGTERM 15 15 15 15 | |
490 | SIGSTKFLT 16 \- \- \07 | |
491 | SIGCHLD 17 20 18 18 | |
492 | SIGCLD \- \- 18 \- | |
493 | SIGCONT 18 19 25 26 | |
494 | SIGSTOP 19 17 23 24 | |
495 | SIGTSTP 20 18 24 25 | |
496 | SIGTTIN 21 21 26 27 | |
497 | SIGTTOU 22 22 27 28 | |
498 | SIGURG 23 16 21 29 | |
499 | SIGXCPU 24 24 30 12 | |
500 | SIGXFSZ 25 25 31 30 | |
501 | SIGVTALRM 26 26 28 20 | |
502 | SIGPROF 27 27 29 21 | |
503 | SIGWINCH 28 28 20 23 | |
504 | SIGIO 29 23 22 22 | |
505 | SIGPOLL Same as SIGIO | |
506 | SIGPWR 30 29/\- 19 19 | |
507 | SIGINFO \- 29/\- \- \- | |
508 | SIGLOST \- \-/29 \- \- | |
509 | SIGSYS 31 12 12 31 | |
510 | SIGUNUSED 31 \- \- 31 | |
511 | .TE | |
512 | .PP | |
513 | Note the following: | |
22356d97 | 514 | .IP \(bu 3 |
9a10a144 MK |
515 | Where defined, |
516 | .B SIGUNUSED | |
517 | is synonymous with | |
518 | .BR SIGSYS . | |
519 | Since glibc 2.26, | |
520 | .B SIGUNUSED | |
521 | is no longer defined on any architecture. | |
22356d97 | 522 | .IP \(bu |
9a10a144 MK |
523 | Signal 29 is |
524 | .BR SIGINFO / SIGPWR | |
525 | (synonyms for the same value) on Alpha but | |
526 | .B SIGLOST | |
527 | on SPARC. | |
528 | .\" | |
73d8cece | 529 | .SS Real-time signals |
6c6aa9a8 | 530 | Starting with version 2.2, |
4dec66f9 MK |
531 | Linux supports real-time signals as originally defined in the POSIX.1b |
532 | real-time extensions (and now included in POSIX.1-2001). | |
5a5574b9 MK |
533 | The range of supported real-time signals is defined by the macros |
534 | .B SIGRTMIN | |
535 | and | |
536 | .BR SIGRTMAX . | |
537 | POSIX.1-2001 requires that an implementation support at least | |
538 | .B _POSIX_RTSIG_MAX | |
539 | (8) real-time signals. | |
540 | .PP | |
373ed9ba MK |
541 | The Linux kernel supports a range of 33 different real-time |
542 | signals, numbered 32 to 64. | |
5a5574b9 | 543 | However, the glibc POSIX threads implementation internally uses |
e0bf9127 | 544 | two (for NPTL) or three (for LinuxThreads) real-time signals |
5a5574b9 MK |
545 | (see |
546 | .BR pthreads (7)), | |
547 | and adjusts the value of | |
548 | .B SIGRTMIN | |
549 | suitably (to 34 or 35). | |
550 | Because the range of available real-time signals varies according | |
551 | to the glibc threading implementation (and this variation can occur | |
cf50118f | 552 | at run time according to the available kernel and glibc), |
008f1ecc | 553 | and indeed the range of real-time signals varies across UNIX systems, |
5a5574b9 MK |
554 | programs should |
555 | .IR "never refer to real-time signals using hard-coded numbers" , | |
556 | but instead should always refer to real-time signals using the notation | |
fea681da | 557 | .BR SIGRTMIN +n, |
e0bf9127 | 558 | and include suitable (run-time) checks that |
5a5574b9 MK |
559 | .BR SIGRTMIN +n |
560 | does not exceed | |
561 | .BR SIGRTMAX . | |
fea681da MK |
562 | .PP |
563 | Unlike standard signals, real-time signals have no predefined meanings: | |
564 | the entire set of real-time signals can be used for application-defined | |
565 | purposes. | |
fea681da MK |
566 | .PP |
567 | The default action for an unhandled real-time signal is to terminate the | |
568 | receiving process. | |
569 | .PP | |
570 | Real-time signals are distinguished by the following: | |
22356d97 | 571 | .IP \(bu 3 |
fea681da MK |
572 | Multiple instances of real-time signals can be queued. |
573 | By contrast, if multiple instances of a standard signal are delivered | |
574 | while that signal is currently blocked, then only one instance is queued. | |
22356d97 | 575 | .IP \(bu |
fea681da | 576 | If the signal is sent using |
485ab701 | 577 | .BR sigqueue (3), |
fea681da MK |
578 | an accompanying value (either an integer or a pointer) can be sent |
579 | with the signal. | |
580 | If the receiving process establishes a handler for this signal using the | |
9fdfa163 | 581 | .B SA_SIGINFO |
fea681da | 582 | flag to |
1c1cbf3d | 583 | .BR sigaction (2), |
fea681da MK |
584 | then it can obtain this data via the |
585 | .I si_value | |
586 | field of the | |
587 | .I siginfo_t | |
588 | structure passed as the second argument to the handler. | |
589 | Furthermore, the | |
590 | .I si_pid | |
591 | and | |
592 | .I si_uid | |
593 | fields of this structure can be used to obtain the PID | |
594 | and real user ID of the process sending the signal. | |
22356d97 | 595 | .IP \(bu |
fea681da MK |
596 | Real-time signals are delivered in a guaranteed order. |
597 | Multiple real-time signals of the same type are delivered in the order | |
598 | they were sent. | |
599 | If different real-time signals are sent to a process, they are delivered | |
600 | starting with the lowest-numbered signal. | |
601 | (I.e., low-numbered signals have highest priority.) | |
4564433c MK |
602 | By contrast, if multiple standard signals are pending for a process, |
603 | the order in which they are delivered is unspecified. | |
fea681da MK |
604 | .PP |
605 | If both standard and real-time signals are pending for a process, | |
606 | POSIX leaves it unspecified which is delivered first. | |
607 | Linux, like many other implementations, gives priority | |
608 | to standard signals in this case. | |
609 | .PP | |
610 | According to POSIX, an implementation should permit at least | |
5a5574b9 MK |
611 | .B _POSIX_SIGQUEUE_MAX |
612 | (32) real-time signals to be queued to | |
fea681da | 613 | a process. |
1c1634c0 MK |
614 | However, Linux does things differently. |
615 | In kernels up to and including 2.6.7, Linux imposes | |
fea681da MK |
616 | a system-wide limit on the number of queued real-time signals |
617 | for all processes. | |
618 | This limit can be viewed and (with privilege) changed via the | |
b49c2acb | 619 | .I /proc/sys/kernel/rtsig\-max |
fea681da MK |
620 | file. |
621 | A related file, | |
b49c2acb | 622 | .IR /proc/sys/kernel/rtsig\-nr , |
fea681da | 623 | can be used to find out how many real-time signals are currently queued. |
1c1634c0 MK |
624 | In Linux 2.6.8, these |
625 | .I /proc | |
de7e5e18 | 626 | interfaces were replaced by the |
1c1634c0 MK |
627 | .B RLIMIT_SIGPENDING |
628 | resource limit, which specifies a per-user limit for queued | |
c0722da0 | 629 | signals; see |
1c1634c0 MK |
630 | .BR setrlimit (2) |
631 | for further details. | |
a721e8b2 | 632 | .PP |
360c1900 | 633 | The addition of real-time signals required the widening |
530156fe MK |
634 | of the signal set structure |
635 | .RI ( sigset_t ) | |
636 | from 32 to 64 bits. | |
637 | Consequently, various system calls were superseded by new system calls | |
638 | that supported the larger signal sets. | |
639 | The old and new system calls are as follows: | |
640 | .TS | |
641 | lb lb | |
642 | l l. | |
643 | Linux 2.0 and earlier Linux 2.2 and later | |
644 | \fBsigaction\fP(2) \fBrt_sigaction\fP(2) | |
645 | \fBsigpending\fP(2) \fBrt_sigpending\fP(2) | |
646 | \fBsigprocmask\fP(2) \fBrt_sigprocmask\fP(2) | |
647 | \fBsigreturn\fP(2) \fBrt_sigreturn\fP(2) | |
648 | \fBsigsuspend\fP(2) \fBrt_sigsuspend\fP(2) | |
649 | \fBsigtimedwait\fP(2) \fBrt_sigtimedwait\fP(2) | |
650 | .TE | |
651 | .\" | |
c634028a | 652 | .SS Interruption of system calls and library functions by signal handlers |
72710182 MK |
653 | If a signal handler is invoked while a system call or library |
654 | function call is blocked, then either: | |
22356d97 | 655 | .IP \(bu 3 |
72710182 | 656 | the call is automatically restarted after the signal handler returns; or |
22356d97 | 657 | .IP \(bu |
72710182 | 658 | the call fails with the error |
af3c87d0 | 659 | .BR EINTR . |
72710182 MK |
660 | .PP |
661 | Which of these two behaviors occurs depends on the interface and | |
662 | whether or not the signal handler was established using the | |
1ae6b2c7 | 663 | .B SA_RESTART |
af3c87d0 MK |
664 | flag (see |
665 | .BR sigaction (2)). | |
008f1ecc | 666 | The details vary across UNIX systems; |
164be4fc | 667 | below, the details for Linux. |
a721e8b2 | 668 | .PP |
72710182 | 669 | If a blocked call to one of the following interfaces is interrupted |
a23d8efa | 670 | by a signal handler, then the call is automatically restarted |
72710182 | 671 | after the signal handler returns if the |
1ae6b2c7 | 672 | .B SA_RESTART |
a23d8efa | 673 | flag was used; otherwise the call fails with the error |
af3c87d0 MK |
674 | .BR EINTR : |
675 | .\" The following system calls use ERESTARTSYS, | |
676 | .\" so that they are restartable | |
22356d97 | 677 | .IP \(bu 3 |
af3c87d0 MK |
678 | .BR read (2), |
679 | .BR readv (2), | |
680 | .BR write (2), | |
681 | .BR writev (2), | |
682 | and | |
683 | .BR ioctl (2) | |
684 | calls on "slow" devices. | |
72710182 MK |
685 | A "slow" device is one where the I/O call may block for an |
686 | indefinite time, for example, a terminal, pipe, or socket. | |
72710182 MK |
687 | If an I/O call on a slow device has already transferred some |
688 | data by the time it is interrupted by a signal handler, | |
af3c87d0 MK |
689 | then the call will return a success status |
690 | (normally, the number of bytes transferred). | |
ae1c1caa MK |
691 | Note that a (local) disk is not a slow device according to this definition; |
692 | I/O operations on disk devices are not interrupted by signals. | |
22356d97 | 693 | .IP \(bu |
af3c87d0 | 694 | .BR open (2), |
72ee5ec2 | 695 | if it can block (e.g., when opening a FIFO; see |
af3c87d0 | 696 | .BR fifo (7)). |
22356d97 | 697 | .IP \(bu |
af3c87d0 MK |
698 | .BR wait (2), |
699 | .BR wait3 (2), | |
700 | .BR wait4 (2), | |
701 | .BR waitid (2), | |
702 | and | |
703 | .BR waitpid (2). | |
22356d97 | 704 | .IP \(bu |
af3c87d0 | 705 | Socket interfaces: |
72710182 | 706 | .\" If a timeout (setsockopt()) is in effect on the socket, then these |
af3c87d0 MK |
707 | .\" system calls switch to using EINTR. Consequently, they and are not |
708 | .\" automatically restarted, and they show the stop/cont behavior | |
709 | .\" described below. (Verified from 2.6.26 source, and by experiment; mtk) | |
710 | .BR accept (2), | |
711 | .BR connect (2), | |
712 | .BR recv (2), | |
713 | .BR recvfrom (2), | |
88fb4f09 | 714 | .BR recvmmsg (2), |
af3c87d0 MK |
715 | .BR recvmsg (2), |
716 | .BR send (2), | |
717 | .BR sendto (2), | |
718 | and | |
4f6d71a1 | 719 | .BR sendmsg (2), |
6248a90b | 720 | .\" FIXME What about sendmmsg()? |
4f6d71a1 | 721 | unless a timeout has been set on the socket (see below). |
22356d97 | 722 | .IP \(bu |
af3c87d0 MK |
723 | File locking interfaces: |
724 | .BR flock (2) | |
725 | and | |
6f0dcebc | 726 | the |
1ae6b2c7 | 727 | .B F_SETLKW |
6f0dcebc | 728 | and |
1ae6b2c7 | 729 | .B F_OFD_SETLKW |
6f0dcebc | 730 | operations of |
af3c87d0 | 731 | .BR fcntl (2) |
22356d97 | 732 | .IP \(bu |
af3c87d0 | 733 | POSIX message queue interfaces: |
c1667735 MK |
734 | .BR mq_receive (3), |
735 | .BR mq_timedreceive (3), | |
736 | .BR mq_send (3), | |
af3c87d0 | 737 | and |
c1667735 | 738 | .BR mq_timedsend (3). |
22356d97 | 739 | .IP \(bu |
af3c87d0 MK |
740 | .BR futex (2) |
741 | .B FUTEX_WAIT | |
4b139190 MK |
742 | (since Linux 2.6.22; |
743 | .\" commit 72c1bbf308c75a136803d2d76d0e18258be14c7a | |
744 | beforehand, always failed with | |
af3c87d0 | 745 | .BR EINTR ). |
22356d97 | 746 | .IP \(bu |
3168ff2d | 747 | .BR getrandom (2). |
22356d97 | 748 | .IP \(bu |
d53ad479 MK |
749 | .BR pthread_mutex_lock (3), |
750 | .BR pthread_cond_wait (3), | |
751 | and related APIs. | |
22356d97 | 752 | .IP \(bu |
4b139190 MK |
753 | .BR futex (2) |
754 | .BR FUTEX_WAIT_BITSET . | |
22356d97 | 755 | .IP \(bu |
af3c87d0 MK |
756 | POSIX semaphore interfaces: |
757 | .BR sem_wait (3) | |
758 | and | |
759 | .BR sem_timedwait (3) | |
4b139190 MK |
760 | (since Linux 2.6.22; |
761 | .\" as a consequence of the 2.6.22 changes in the futex() implementation | |
762 | beforehand, always failed with | |
af3c87d0 | 763 | .BR EINTR ). |
22356d97 | 764 | .IP \(bu |
8b6e88b2 MK |
765 | .BR read (2) |
766 | from an | |
767 | .BR inotify (7) | |
768 | file descriptor | |
769 | (since Linux 3.8; | |
770 | .\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06 | |
771 | beforehand, always failed with | |
772 | .BR EINTR ). | |
af3c87d0 MK |
773 | .PP |
774 | The following interfaces are never restarted after | |
775 | being interrupted by a signal handler, | |
776 | regardless of the use of | |
495edd81 MK |
777 | .BR SA_RESTART ; |
778 | they always fail with the error | |
779 | .B EINTR | |
780 | when interrupted by a signal handler: | |
af3c87d0 MK |
781 | .\" These are the system calls that give EINTR or ERESTARTNOHAND |
782 | .\" on interruption by a signal handler. | |
22356d97 | 783 | .IP \(bu 3 |
8efc0168 MK |
784 | "Input" socket interfaces, when a timeout |
785 | .RB ( SO_RCVTIMEO ) | |
786 | has been set on the socket using | |
4f6d71a1 MK |
787 | .BR setsockopt (2): |
788 | .BR accept (2), | |
789 | .BR recv (2), | |
790 | .BR recvfrom (2), | |
88fb4f09 | 791 | .BR recvmmsg (2) |
8efc0168 | 792 | (also with a non-NULL |
1ae6b2c7 | 793 | .I timeout |
88fb4f09 | 794 | argument), |
4f6d71a1 | 795 | and |
8efc0168 | 796 | .BR recvmsg (2). |
22356d97 | 797 | .IP \(bu |
8efc0168 | 798 | "Output" socket interfaces, when a timeout |
4b139190 | 799 | .RB ( SO_RCVTIMEO ) |
8efc0168 MK |
800 | has been set on the socket using |
801 | .BR setsockopt (2): | |
4f6d71a1 MK |
802 | .BR connect (2), |
803 | .BR send (2), | |
804 | .BR sendto (2), | |
805 | and | |
8efc0168 | 806 | .BR sendmsg (2). |
6248a90b | 807 | .\" FIXME What about sendmmsg()? |
22356d97 | 808 | .IP \(bu |
af3c87d0 MK |
809 | Interfaces used to wait for signals: |
810 | .BR pause (2), | |
811 | .BR sigsuspend (2), | |
743bc395 | 812 | .BR sigtimedwait (2), |
af3c87d0 MK |
813 | and |
814 | .BR sigwaitinfo (2). | |
22356d97 | 815 | .IP \(bu |
af3c87d0 MK |
816 | File descriptor multiplexing interfaces: |
817 | .BR epoll_wait (2), | |
818 | .BR epoll_pwait (2), | |
819 | .BR poll (2), | |
820 | .BR ppoll (2), | |
821 | .BR select (2), | |
822 | and | |
823 | .BR pselect (2). | |
22356d97 | 824 | .IP \(bu |
b24473a3 | 825 | System V IPC interfaces: |
af3c87d0 MK |
826 | .\" On some other systems, SA_RESTART does restart these system calls |
827 | .BR msgrcv (2), | |
828 | .BR msgsnd (2), | |
829 | .BR semop (2), | |
830 | and | |
831 | .BR semtimedop (2). | |
22356d97 | 832 | .IP \(bu |
af3c87d0 MK |
833 | Sleep interfaces: |
834 | .BR clock_nanosleep (2), | |
835 | .BR nanosleep (2), | |
af3c87d0 MK |
836 | and |
837 | .BR usleep (3). | |
22356d97 | 838 | .IP \(bu |
af3c87d0 | 839 | .BR io_getevents (2). |
495edd81 MK |
840 | .PP |
841 | The | |
842 | .BR sleep (3) | |
843 | function is also never restarted if interrupted by a handler, | |
844 | but gives a success return: the number of seconds remaining to sleep. | |
730a8d48 MK |
845 | .PP |
846 | In certain circumstances, the | |
847 | .BR seccomp (2) | |
848 | user-space notification feature can lead to restarting of system calls | |
849 | that would otherwise never be restarted by | |
850 | .BR SA_RESTART ; | |
851 | for details, see | |
852 | .BR seccomp_unotify (2). | |
853 | .\" | |
c634028a | 854 | .SS Interruption of system calls and library functions by stop signals |
48b9ec3f MK |
855 | On Linux, even in the absence of signal handlers, |
856 | certain blocking interfaces can fail with the error | |
1ae6b2c7 | 857 | .B EINTR |
48b9ec3f MK |
858 | after the process is stopped by one of the stop signals |
859 | and then resumed via | |
860 | .BR SIGCONT . | |
861 | This behavior is not sanctioned by POSIX.1, and doesn't occur | |
862 | on other systems. | |
a721e8b2 | 863 | .PP |
48b9ec3f | 864 | The Linux interfaces that display this behavior are: |
22356d97 | 865 | .IP \(bu 3 |
8efc0168 MK |
866 | "Input" socket interfaces, when a timeout |
867 | .RB ( SO_RCVTIMEO ) | |
868 | has been set on the socket using | |
4f6d71a1 MK |
869 | .BR setsockopt (2): |
870 | .BR accept (2), | |
871 | .BR recv (2), | |
872 | .BR recvfrom (2), | |
88fb4f09 | 873 | .BR recvmmsg (2) |
8efc0168 | 874 | (also with a non-NULL |
1ae6b2c7 | 875 | .I timeout |
88fb4f09 | 876 | argument), |
4f6d71a1 | 877 | and |
8efc0168 | 878 | .BR recvmsg (2). |
22356d97 | 879 | .IP \(bu |
8efc0168 | 880 | "Output" socket interfaces, when a timeout |
4b139190 | 881 | .RB ( SO_RCVTIMEO ) |
8efc0168 MK |
882 | has been set on the socket using |
883 | .BR setsockopt (2): | |
4f6d71a1 MK |
884 | .BR connect (2), |
885 | .BR send (2), | |
886 | .BR sendto (2), | |
887 | and | |
4b139190 MK |
888 | .\" FIXME What about sendmmsg()? |
889 | .BR sendmsg (2), | |
890 | if a send timeout | |
891 | .RB ( SO_SNDTIMEO ) | |
892 | has been set. | |
22356d97 | 893 | .IP \(bu |
48b9ec3f MK |
894 | .BR epoll_wait (2), |
895 | .BR epoll_pwait (2). | |
22356d97 | 896 | .IP \(bu |
48b9ec3f MK |
897 | .BR semop (2), |
898 | .BR semtimedop (2). | |
22356d97 | 899 | .IP \(bu |
48b9ec3f MK |
900 | .BR sigtimedwait (2), |
901 | .BR sigwaitinfo (2). | |
22356d97 | 902 | .IP \(bu |
e3fe7572 | 903 | Linux 3.7 and earlier: |
48b9ec3f MK |
904 | .BR read (2) |
905 | from an | |
906 | .BR inotify (7) | |
e3fe7572 MK |
907 | file descriptor |
908 | .\" commit 1ca39ab9d21ac93f94b9e3eb364ea9a5cf2aba06 | |
22356d97 | 909 | .IP \(bu |
48b9ec3f MK |
910 | Linux 2.6.21 and earlier: |
911 | .BR futex (2) | |
912 | .BR FUTEX_WAIT , | |
913 | .BR sem_timedwait (3), | |
914 | .BR sem_wait (3). | |
22356d97 | 915 | .IP \(bu |
48b9ec3f MK |
916 | Linux 2.6.8 and earlier: |
917 | .BR msgrcv (2), | |
918 | .BR msgsnd (2). | |
22356d97 | 919 | .IP \(bu |
48b9ec3f MK |
920 | Linux 2.4 and earlier: |
921 | .BR nanosleep (2). | |
3113c7f3 | 922 | .SH STANDARDS |
495edd81 | 923 | POSIX.1, except as noted. |
81b8997f MK |
924 | .SH NOTES |
925 | For a discussion of async-signal-safe functions, see | |
28a4c58c | 926 | .BR signal\-safety (7). |
81b8997f MK |
927 | .PP |
928 | The | |
929 | .I /proc/[pid]/task/[tid]/status | |
930 | file contains various fields that show the signals | |
931 | that a thread is blocking | |
932 | .RI ( SigBlk ), | |
933 | catching | |
934 | .RI ( SigCgt ), | |
935 | or ignoring | |
936 | .RI ( SigIgn ). | |
937 | (The set of signals that are caught or ignored will be the same | |
938 | across all threads in a process.) | |
939 | Other fields show the set of pending signals that are directed to the thread | |
940 | .RI ( SigPnd ) | |
941 | as well as the set of pending signals that are directed | |
942 | to the process as a whole | |
943 | .RI ( ShdPnd ). | |
944 | The corresponding fields in | |
945 | .I /proc/[pid]/status | |
946 | show the information for the main thread. | |
947 | See | |
948 | .BR proc (5) | |
949 | for further details. | |
d128b5b7 ZW |
950 | .SH BUGS |
951 | There are six signals that can be delivered | |
952 | as a consequence of a hardware exception: | |
953 | .BR SIGBUS , | |
954 | .BR SIGEMT , | |
955 | .BR SIGFPE , | |
956 | .BR SIGILL , | |
957 | .BR SIGSEGV , | |
958 | and | |
959 | .BR SIGTRAP . | |
960 | Which of these signals is delivered, | |
961 | for any given hardware exception, | |
962 | is not documented and does not always make sense. | |
963 | .PP | |
964 | For example, an invalid memory access that causes delivery of | |
965 | .B SIGSEGV | |
966 | on one CPU architecture may cause delivery of | |
967 | .B SIGBUS | |
968 | on another architecture, or vice versa. | |
969 | .PP | |
970 | For another example, using the x86 | |
971 | .I int | |
972 | instruction with a forbidden argument | |
973 | (any number other than 3 or 128) | |
974 | causes delivery of | |
975 | .BR SIGSEGV , | |
976 | even though | |
977 | .B SIGILL | |
978 | would make more sense, | |
979 | because of how the CPU reports the forbidden operation to the kernel. | |
47297adb | 980 | .SH SEE ALSO |
fea681da | 981 | .BR kill (1), |
96123f41 | 982 | .BR clone (2), |
8c69c923 | 983 | .BR getrlimit (2), |
fea681da | 984 | .BR kill (2), |
c8fb1c6d | 985 | .BR pidfd_send_signal (2), |
d806bc05 | 986 | .BR restart_syscall (2), |
23038eae | 987 | .BR rt_sigqueueinfo (2), |
af3c87d0 MK |
988 | .BR setitimer (2), |
989 | .BR setrlimit (2), | |
990 | .BR sgetmask (2), | |
991 | .BR sigaction (2), | |
8c69c923 | 992 | .BR sigaltstack (2), |
af3c87d0 | 993 | .BR signal (2), |
058c1165 | 994 | .BR signalfd (2), |
af3c87d0 MK |
995 | .BR sigpending (2), |
996 | .BR sigprocmask (2), | |
7d80ac37 | 997 | .BR sigreturn (2), |
af3c87d0 MK |
998 | .BR sigsuspend (2), |
999 | .BR sigwaitinfo (2), | |
8c69c923 | 1000 | .BR abort (3), |
af3c87d0 | 1001 | .BR bsd_signal (3), |
498aad50 | 1002 | .BR killpg (3), |
8c69c923 | 1003 | .BR longjmp (3), |
36757dc1 | 1004 | .BR pthread_sigqueue (3), |
b4cb896f | 1005 | .BR raise (3), |
485ab701 | 1006 | .BR sigqueue (3), |
af3c87d0 | 1007 | .BR sigset (3), |
8c69c923 MK |
1008 | .BR sigsetops (3), |
1009 | .BR sigvec (3), | |
7c85aa6b | 1010 | .BR sigwait (3), |
af3c87d0 | 1011 | .BR strsignal (3), |
1374ba42 | 1012 | .BR swapcontext (3), |
af3c87d0 | 1013 | .BR sysv_signal (3), |
e1a9bc1b | 1014 | .BR core (5), |
4f62997d | 1015 | .BR proc (5), |
cb066271 | 1016 | .BR nptl (7), |
16ca4564 MK |
1017 | .BR pthreads (7), |
1018 | .BR sigevent (7) |