1sigaction(2) System Calls Manual sigaction(2)
2
3
4
6 sigaction, rt_sigaction - examine and change a signal action
7
9 Standard C library (libc, -lc)
10
12 #include <signal.h>
13
14 int sigaction(int signum,
15 const struct sigaction *_Nullable restrict act,
16 struct sigaction *_Nullable restrict oldact);
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 sigaction():
21 _POSIX_C_SOURCE
22
23 siginfo_t:
24 _POSIX_C_SOURCE >= 199309L
25
27 The sigaction() system call is used to change the action taken by a
28 process on receipt of a specific signal. (See signal(7) for an over‐
29 view of signals.)
30
31 signum specifies the signal and can be any valid signal except SIGKILL
32 and SIGSTOP.
33
34 If act is non-NULL, the new action for signal signum is installed from
35 act. If oldact is non-NULL, the previous action is saved in oldact.
36
37 The sigaction structure is defined as something like:
38
39 struct sigaction {
40 void (*sa_handler)(int);
41 void (*sa_sigaction)(int, siginfo_t *, void *);
42 sigset_t sa_mask;
43 int sa_flags;
44 void (*sa_restorer)(void);
45 };
46
47 On some architectures a union is involved: do not assign to both
48 sa_handler and sa_sigaction.
49
50 The sa_restorer field is not intended for application use. (POSIX does
51 not specify a sa_restorer field.) Some further details of the purpose
52 of this field can be found in sigreturn(2).
53
54 sa_handler specifies the action to be associated with signum and can be
55 one of the following:
56
57 • SIG_DFL for the default action.
58
59 • SIG_IGN to ignore this signal.
60
61 • A pointer to a signal handling function. This function receives the
62 signal number as its only argument.
63
64 If SA_SIGINFO is specified in sa_flags, then sa_sigaction (instead of
65 sa_handler) specifies the signal-handling function for signum. This
66 function receives three arguments, as described below.
67
68 sa_mask specifies a mask of signals which should be blocked (i.e.,
69 added to the signal mask of the thread in which the signal handler is
70 invoked) during execution of the signal handler. In addition, the sig‐
71 nal which triggered the handler will be blocked, unless the SA_NODEFER
72 flag is used.
73
74 sa_flags specifies a set of flags which modify the behavior of the sig‐
75 nal. It is formed by the bitwise OR of zero or more of the following:
76
77 SA_NOCLDSTOP
78 If signum is SIGCHLD, do not receive notification when child
79 processes stop (i.e., when they receive one of SIGSTOP, SIGTSTP,
80 SIGTTIN, or SIGTTOU) or resume (i.e., they receive SIGCONT) (see
81 wait(2)). This flag is meaningful only when establishing a han‐
82 dler for SIGCHLD.
83
84 SA_NOCLDWAIT (since Linux 2.6)
85 If signum is SIGCHLD, do not transform children into zombies
86 when they terminate. See also waitpid(2). This flag is mean‐
87 ingful only when establishing a handler for SIGCHLD, or when
88 setting that signal's disposition to SIG_DFL.
89
90 If the SA_NOCLDWAIT flag is set when establishing a handler for
91 SIGCHLD, POSIX.1 leaves it unspecified whether a SIGCHLD signal
92 is generated when a child process terminates. On Linux, a
93 SIGCHLD signal is generated in this case; on some other imple‐
94 mentations, it is not.
95
96 SA_NODEFER
97 Do not add the signal to the thread's signal mask while the han‐
98 dler is executing, unless the signal is specified in
99 act.sa_mask. Consequently, a further instance of the signal may
100 be delivered to the thread while it is executing the handler.
101 This flag is meaningful only when establishing a signal handler.
102
103 SA_NOMASK is an obsolete, nonstandard synonym for this flag.
104
105 SA_ONSTACK
106 Call the signal handler on an alternate signal stack provided by
107 sigaltstack(2). If an alternate stack is not available, the de‐
108 fault stack will be used. This flag is meaningful only when es‐
109 tablishing a signal handler.
110
111 SA_RESETHAND
112 Restore the signal action to the default upon entry to the sig‐
113 nal handler. This flag is meaningful only when establishing a
114 signal handler.
115
116 SA_ONESHOT is an obsolete, nonstandard synonym for this flag.
117
118 SA_RESTART
119 Provide behavior compatible with BSD signal semantics by making
120 certain system calls restartable across signals. This flag is
121 meaningful only when establishing a signal handler. See sig‐
122 nal(7) for a discussion of system call restarting.
123
124 SA_RESTORER
125 Not intended for application use. This flag is used by C li‐
126 braries to indicate that the sa_restorer field contains the ad‐
127 dress of a "signal trampoline". See sigreturn(2) for more de‐
128 tails.
129
130 SA_SIGINFO (since Linux 2.2)
131 The signal handler takes three arguments, not one. In this
132 case, sa_sigaction should be set instead of sa_handler. This
133 flag is meaningful only when establishing a signal handler.
134
135 SA_UNSUPPORTED (since Linux 5.11)
136 Used to dynamically probe for flag bit support.
137
138 If an attempt to register a handler succeeds with this flag set
139 in act->sa_flags alongside other flags that are potentially un‐
140 supported by the kernel, and an immediately subsequent sigac‐
141 tion() call specifying the same signal number and with a non-
142 NULL oldact argument yields SA_UNSUPPORTED clear in
143 oldact->sa_flags, then oldact->sa_flags may be used as a bitmask
144 describing which of the potentially unsupported flags are, in
145 fact, supported. See the section "Dynamically probing for flag
146 bit support" below for more details.
147
148 SA_EXPOSE_TAGBITS (since Linux 5.11)
149 Normally, when delivering a signal, an architecture-specific set
150 of tag bits are cleared from the si_addr field of siginfo_t. If
151 this flag is set, an architecture-specific subset of the tag
152 bits will be preserved in si_addr.
153
154 Programs that need to be compatible with Linux versions older
155 than 5.11 must use SA_UNSUPPORTED to probe for support.
156
157 The siginfo_t argument to a SA_SIGINFO handler
158 When the SA_SIGINFO flag is specified in act.sa_flags, the signal han‐
159 dler address is passed via the act.sa_sigaction field. This handler
160 takes three arguments, as follows:
161
162 void
163 handler(int sig, siginfo_t *info, void *ucontext)
164 {
165 ...
166 }
167
168 These three arguments are as follows
169
170 sig The number of the signal that caused invocation of the handler.
171
172 info A pointer to a siginfo_t, which is a structure containing fur‐
173 ther information about the signal, as described below.
174
175 ucontext
176 This is a pointer to a ucontext_t structure, cast to void *.
177 The structure pointed to by this field contains signal context
178 information that was saved on the user-space stack by the ker‐
179 nel; for details, see sigreturn(2). Further information about
180 the ucontext_t structure can be found in getcontext(3) and sig‐
181 nal(7). Commonly, the handler function doesn't make any use of
182 the third argument.
183
184 The siginfo_t data type is a structure with the following fields:
185
186 siginfo_t {
187 int si_signo; /* Signal number */
188 int si_errno; /* An errno value */
189 int si_code; /* Signal code */
190 int si_trapno; /* Trap number that caused
191 hardware-generated signal
192 (unused on most architectures) */
193 pid_t si_pid; /* Sending process ID */
194 uid_t si_uid; /* Real user ID of sending process */
195 int si_status; /* Exit value or signal */
196 clock_t si_utime; /* User time consumed */
197 clock_t si_stime; /* System time consumed */
198 union sigval si_value; /* Signal value */
199 int si_int; /* POSIX.1b signal */
200 void *si_ptr; /* POSIX.1b signal */
201 int si_overrun; /* Timer overrun count;
202 POSIX.1b timers */
203 int si_timerid; /* Timer ID; POSIX.1b timers */
204 void *si_addr; /* Memory location which caused fault */
205 long si_band; /* Band event (was int in
206 glibc 2.3.2 and earlier) */
207 int si_fd; /* File descriptor */
208 short si_addr_lsb; /* Least significant bit of address
209 (since Linux 2.6.32) */
210 void *si_lower; /* Lower bound when address violation
211 occurred (since Linux 3.19) */
212 void *si_upper; /* Upper bound when address violation
213 occurred (since Linux 3.19) */
214 int si_pkey; /* Protection key on PTE that caused
215 fault (since Linux 4.6) */
216 void *si_call_addr; /* Address of system call instruction
217 (since Linux 3.5) */
218 int si_syscall; /* Number of attempted system call
219 (since Linux 3.5) */
220 unsigned int si_arch; /* Architecture of attempted system call
221 (since Linux 3.5) */
222 }
223
224 si_signo, si_errno and si_code are defined for all signals. (si_errno
225 is generally unused on Linux.) The rest of the struct may be a union,
226 so that one should read only the fields that are meaningful for the
227 given signal:
228
229 • Signals sent with kill(2) and sigqueue(3) fill in si_pid and si_uid.
230 In addition, signals sent with sigqueue(3) fill in si_int and si_ptr
231 with the values specified by the sender of the signal; see
232 sigqueue(3) for more details.
233
234 • Signals sent by POSIX.1b timers (since Linux 2.6) fill in si_overrun
235 and si_timerid. The si_timerid field is an internal ID used by the
236 kernel to identify the timer; it is not the same as the timer ID re‐
237 turned by timer_create(2). The si_overrun field is the timer over‐
238 run count; this is the same information as is obtained by a call to
239 timer_getoverrun(2). These fields are nonstandard Linux extensions.
240
241 • Signals sent for message queue notification (see the description of
242 SIGEV_SIGNAL in mq_notify(3)) fill in si_int/si_ptr, with the
243 sigev_value supplied to mq_notify(3); si_pid, with the process ID of
244 the message sender; and si_uid, with the real user ID of the message
245 sender.
246
247 • SIGCHLD fills in si_pid, si_uid, si_status, si_utime, and si_stime,
248 providing information about the child. The si_pid field is the
249 process ID of the child; si_uid is the child's real user ID. The
250 si_status field contains the exit status of the child (if si_code is
251 CLD_EXITED), or the signal number that caused the process to change
252 state. The si_utime and si_stime contain the user and system CPU
253 time used by the child process; these fields do not include the
254 times used by waited-for children (unlike getrusage(2) and
255 times(2)). Up to Linux 2.6, and since Linux 2.6.27, these fields
256 report CPU time in units of sysconf(_SC_CLK_TCK). In Linux 2.6 ker‐
257 nels before Linux 2.6.27, a bug meant that these fields reported
258 time in units of the (configurable) system jiffy (see time(7)).
259
260 • SIGILL, SIGFPE, SIGSEGV, SIGBUS, and SIGTRAP fill in si_addr with
261 the address of the fault. On some architectures, these signals also
262 fill in the si_trapno field.
263
264 Some suberrors of SIGBUS, in particular BUS_MCEERR_AO and
265 BUS_MCEERR_AR, also fill in si_addr_lsb. This field indicates the
266 least significant bit of the reported address and therefore the ex‐
267 tent of the corruption. For example, if a full page was corrupted,
268 si_addr_lsb contains log2(sysconf(_SC_PAGESIZE)). When SIGTRAP is
269 delivered in response to a ptrace(2) event (PTRACE_EVENT_foo),
270 si_addr is not populated, but si_pid and si_uid are populated with
271 the respective process ID and user ID responsible for delivering the
272 trap. In the case of seccomp(2), the tracee will be shown as deliv‐
273 ering the event. BUS_MCEERR_* and si_addr_lsb are Linux-specific
274 extensions.
275
276 The SEGV_BNDERR suberror of SIGSEGV populates si_lower and si_upper.
277
278 The SEGV_PKUERR suberror of SIGSEGV populates si_pkey.
279
280 • SIGIO/SIGPOLL (the two names are synonyms on Linux) fills in si_band
281 and si_fd. The si_band event is a bit mask containing the same val‐
282 ues as are filled in the revents field by poll(2). The si_fd field
283 indicates the file descriptor for which the I/O event occurred; for
284 further details, see the description of F_SETSIG in fcntl(2).
285
286 • SIGSYS, generated (since Linux 3.5) when a seccomp filter returns
287 SECCOMP_RET_TRAP, fills in si_call_addr, si_syscall, si_arch, si_er‐
288 rno, and other fields as described in seccomp(2).
289
290 The si_code field
291 The si_code field inside the siginfo_t argument that is passed to a
292 SA_SIGINFO signal handler is a value (not a bit mask) indicating why
293 this signal was sent. For a ptrace(2) event, si_code will contain SIG‐
294 TRAP and have the ptrace event in the high byte:
295
296 (SIGTRAP | PTRACE_EVENT_foo << 8).
297
298 For a non-ptrace(2) event, the values that can appear in si_code are
299 described in the remainder of this section. Since glibc 2.20, the def‐
300 initions of most of these symbols are obtained from <signal.h> by
301 defining feature test macros (before including any header file) as fol‐
302 lows:
303
304 • _XOPEN_SOURCE with the value 500 or greater;
305
306 • _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED; or
307
308 • _POSIX_C_SOURCE with the value 200809L or greater.
309
310 For the TRAP_* constants, the symbol definitions are provided only in
311 the first two cases. Before glibc 2.20, no feature test macros were
312 required to obtain these symbols.
313
314 For a regular signal, the following list shows the values which can be
315 placed in si_code for any signal, along with the reason that the signal
316 was generated.
317
318 SI_USER
319 kill(2).
320
321 SI_KERNEL
322 Sent by the kernel.
323
324 SI_QUEUE
325 sigqueue(3).
326
327 SI_TIMER
328 POSIX timer expired.
329
330 SI_MESGQ (since Linux 2.6.6)
331 POSIX message queue state changed; see mq_notify(3).
332
333 SI_ASYNCIO
334 AIO completed.
335
336 SI_SIGIO
337 Queued SIGIO (only up to Linux 2.2; from Linux 2.4 onward
338 SIGIO/SIGPOLL fills in si_code as described below).
339
340 SI_TKILL (since Linux 2.4.19)
341 tkill(2) or tgkill(2).
342
343 The following values can be placed in si_code for a SIGILL signal:
344
345 ILL_ILLOPC
346 Illegal opcode.
347
348 ILL_ILLOPN
349 Illegal operand.
350
351 ILL_ILLADR
352 Illegal addressing mode.
353
354 ILL_ILLTRP
355 Illegal trap.
356
357 ILL_PRVOPC
358 Privileged opcode.
359
360 ILL_PRVREG
361 Privileged register.
362
363 ILL_COPROC
364 Coprocessor error.
365
366 ILL_BADSTK
367 Internal stack error.
368
369 The following values can be placed in si_code for a SIGFPE signal:
370
371 FPE_INTDIV
372 Integer divide by zero.
373
374 FPE_INTOVF
375 Integer overflow.
376
377 FPE_FLTDIV
378 Floating-point divide by zero.
379
380 FPE_FLTOVF
381 Floating-point overflow.
382
383 FPE_FLTUND
384 Floating-point underflow.
385
386 FPE_FLTRES
387 Floating-point inexact result.
388
389 FPE_FLTINV
390 Floating-point invalid operation.
391
392 FPE_FLTSUB
393 Subscript out of range.
394
395 The following values can be placed in si_code for a SIGSEGV signal:
396
397 SEGV_MAPERR
398 Address not mapped to object.
399
400 SEGV_ACCERR
401 Invalid permissions for mapped object.
402
403 SEGV_BNDERR (since Linux 3.19)
404 Failed address bound checks.
405
406 SEGV_PKUERR (since Linux 4.6)
407 Access was denied by memory protection keys. See pkeys(7).
408 The protection key which applied to this access is available
409 via si_pkey.
410
411 The following values can be placed in si_code for a SIGBUS signal:
412
413 BUS_ADRALN
414 Invalid address alignment.
415
416 BUS_ADRERR
417 Nonexistent physical address.
418
419 BUS_OBJERR
420 Object-specific hardware error.
421
422 BUS_MCEERR_AR (since Linux 2.6.32)
423 Hardware memory error consumed on a machine check; action
424 required.
425
426 BUS_MCEERR_AO (since Linux 2.6.32)
427 Hardware memory error detected in process but not consumed;
428 action optional.
429
430 The following values can be placed in si_code for a SIGTRAP signal:
431
432 TRAP_BRKPT
433 Process breakpoint.
434
435 TRAP_TRACE
436 Process trace trap.
437
438 TRAP_BRANCH (since Linux 2.4, IA64 only)
439 Process taken branch trap.
440
441 TRAP_HWBKPT (since Linux 2.4, IA64 only)
442 Hardware breakpoint/watchpoint.
443
444 The following values can be placed in si_code for a SIGCHLD signal:
445
446 CLD_EXITED
447 Child has exited.
448
449 CLD_KILLED
450 Child was killed.
451
452 CLD_DUMPED
453 Child terminated abnormally.
454
455 CLD_TRAPPED
456 Traced child has trapped.
457
458 CLD_STOPPED
459 Child has stopped.
460
461 CLD_CONTINUED (since Linux 2.6.9)
462 Stopped child has continued.
463
464 The following values can be placed in si_code for a SIGIO/SIGPOLL sig‐
465 nal:
466
467 POLL_IN
468 Data input available.
469
470 POLL_OUT
471 Output buffers available.
472
473 POLL_MSG
474 Input message available.
475
476 POLL_ERR
477 I/O error.
478
479 POLL_PRI
480 High priority input available.
481
482 POLL_HUP
483 Device disconnected.
484
485 The following value can be placed in si_code for a SIGSYS signal:
486
487 SYS_SECCOMP (since Linux 3.5)
488 Triggered by a seccomp(2) filter rule.
489
490 Dynamically probing for flag bit support
491 The sigaction() call on Linux accepts unknown bits set in act->sa_flags
492 without error. The behavior of the kernel starting with Linux 5.11 is
493 that a second sigaction() will clear unknown bits from
494 oldact->sa_flags. However, historically, a second sigaction() call
495 would typically leave those bits set in oldact->sa_flags.
496
497 This means that support for new flags cannot be detected simply by
498 testing for a flag in sa_flags, and a program must test that SA_UNSUP‐
499 PORTED has been cleared before relying on the contents of sa_flags.
500
501 Since the behavior of the signal handler cannot be guaranteed unless
502 the check passes, it is wise to either block the affected signal while
503 registering the handler and performing the check in this case, or where
504 this is not possible, for example if the signal is synchronous, to is‐
505 sue the second sigaction() in the signal handler itself.
506
507 In kernels that do not support a specific flag, the kernel's behavior
508 is as if the flag was not set, even if the flag was set in
509 act->sa_flags.
510
511 The flags SA_NOCLDSTOP, SA_NOCLDWAIT, SA_SIGINFO, SA_ONSTACK,
512 SA_RESTART, SA_NODEFER, SA_RESETHAND, and, if defined by the architec‐
513 ture, SA_RESTORER may not be reliably probed for using this mechanism,
514 because they were introduced before Linux 5.11. However, in general,
515 programs may assume that these flags are supported, since they have all
516 been supported since Linux 2.6, which was released in the year 2003.
517
518 See EXAMPLES below for a demonstration of the use of SA_UNSUPPORTED.
519
521 sigaction() returns 0 on success; on error, -1 is returned, and errno
522 is set to indicate the error.
523
525 EFAULT act or oldact points to memory which is not a valid part of the
526 process address space.
527
528 EINVAL An invalid signal was specified. This will also be generated if
529 an attempt is made to change the action for SIGKILL or SIGSTOP,
530 which cannot be caught or ignored.
531
533 C library/kernel differences
534 The glibc wrapper function for sigaction() gives an error (EINVAL) on
535 attempts to change the disposition of the two real-time signals used
536 internally by the NPTL threading implementation. See nptl(7) for de‐
537 tails.
538
539 On architectures where the signal trampoline resides in the C library,
540 the glibc wrapper function for sigaction() places the address of the
541 trampoline code in the act.sa_restorer field and sets the SA_RESTORER
542 flag in the act.sa_flags field. See sigreturn(2).
543
544 The original Linux system call was named sigaction(). However, with
545 the addition of real-time signals in Linux 2.2, the fixed-size, 32-bit
546 sigset_t type supported by that system call was no longer fit for pur‐
547 pose. Consequently, a new system call, rt_sigaction(), was added to
548 support an enlarged sigset_t type. The new system call takes a fourth
549 argument, size_t sigsetsize, which specifies the size in bytes of the
550 signal sets in act.sa_mask and oldact.sa_mask. This argument is cur‐
551 rently required to have the value sizeof(sigset_t) (or the error EINVAL
552 results). The glibc sigaction() wrapper function hides these details
553 from us, transparently calling rt_sigaction() when the kernel provides
554 it.
555
557 POSIX.1-2008.
558
560 POSIX.1-2001, SVr4.
561
562 POSIX.1-1990 disallowed setting the action for SIGCHLD to SIG_IGN.
563 POSIX.1-2001 and later allow this possibility, so that ignoring SIGCHLD
564 can be used to prevent the creation of zombies (see wait(2)). Never‐
565 theless, the historical BSD and System V behaviors for ignoring SIGCHLD
566 differ, so that the only completely portable method of ensuring that
567 terminated children do not become zombies is to catch the SIGCHLD sig‐
568 nal and perform a wait(2) or similar.
569
570 POSIX.1-1990 specified only SA_NOCLDSTOP. POSIX.1-2001 added SA_NOCLD‐
571 STOP, SA_NOCLDWAIT, SA_NODEFER, SA_ONSTACK, SA_RESETHAND, SA_RESTART,
572 and SA_SIGINFO. Use of these latter values in sa_flags may be less
573 portable in applications intended for older UNIX implementations.
574
575 The SA_RESETHAND flag is compatible with the SVr4 flag of the same
576 name.
577
578 The SA_NODEFER flag is compatible with the SVr4 flag of the same name
579 under kernels 1.3.9 and later. On older kernels the Linux implementa‐
580 tion allowed the receipt of any signal, not just the one we are in‐
581 stalling (effectively overriding any sa_mask settings).
582
584 A child created via fork(2) inherits a copy of its parent's signal dis‐
585 positions. During an execve(2), the dispositions of handled signals
586 are reset to the default; the dispositions of ignored signals are left
587 unchanged.
588
589 According to POSIX, the behavior of a process is undefined after it ig‐
590 nores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by
591 kill(2) or raise(3). Integer division by zero has undefined result.
592 On some architectures it will generate a SIGFPE signal. (Also dividing
593 the most negative integer by -1 may generate SIGFPE.) Ignoring this
594 signal might lead to an endless loop.
595
596 sigaction() can be called with a NULL second argument to query the cur‐
597 rent signal handler. It can also be used to check whether a given sig‐
598 nal is valid for the current machine by calling it with NULL second and
599 third arguments.
600
601 It is not possible to block SIGKILL or SIGSTOP (by specifying them in
602 sa_mask). Attempts to do so are silently ignored.
603
604 See sigsetops(3) for details on manipulating signal sets.
605
606 See signal-safety(7) for a list of the async-signal-safe functions that
607 can be safely called inside from inside a signal handler.
608
609 Undocumented
610 Before the introduction of SA_SIGINFO, it was also possible to get some
611 additional information about the signal. This was done by providing an
612 sa_handler signal handler with a second argument of type struct sigcon‐
613 text, which is the same structure as the one that is passed in the
614 uc_mcontext field of the ucontext structure that is passed (via a
615 pointer) in the third argument of the sa_sigaction handler. See the
616 relevant Linux kernel sources for details. This use is obsolete now.
617
619 When delivering a signal with a SA_SIGINFO handler, the kernel does not
620 always provide meaningful values for all of the fields of the siginfo_t
621 that are relevant for that signal.
622
623 Up to and including Linux 2.6.13, specifying SA_NODEFER in sa_flags
624 prevents not only the delivered signal from being masked during execu‐
625 tion of the handler, but also the signals specified in sa_mask. This
626 bug was fixed in Linux 2.6.14.
627
629 See mprotect(2).
630
631 Probing for flag support
632 The following example program exits with status EXIT_SUCCESS if SA_EX‐
633 POSE_TAGBITS is determined to be supported, and EXIT_FAILURE otherwise.
634
635 #include <signal.h>
636 #include <stdio.h>
637 #include <stdlib.h>
638 #include <unistd.h>
639
640 void
641 handler(int signo, siginfo_t *info, void *context)
642 {
643 struct sigaction oldact;
644
645 if (sigaction(SIGSEGV, NULL, &oldact) == -1
646 || (oldact.sa_flags & SA_UNSUPPORTED)
647 || !(oldact.sa_flags & SA_EXPOSE_TAGBITS))
648 {
649 _exit(EXIT_FAILURE);
650 }
651 _exit(EXIT_SUCCESS);
652 }
653
654 int
655 main(void)
656 {
657 struct sigaction act = { 0 };
658
659 act.sa_flags = SA_SIGINFO | SA_UNSUPPORTED | SA_EXPOSE_TAGBITS;
660 act.sa_sigaction = &handler;
661 if (sigaction(SIGSEGV, &act, NULL) == -1) {
662 perror("sigaction");
663 exit(EXIT_FAILURE);
664 }
665
666 raise(SIGSEGV);
667 }
668
670 kill(1), kill(2), pause(2), pidfd_send_signal(2), restart_syscall(2),
671 seccomp(2), sigaltstack(2), signal(2), signalfd(2), sigpending(2), sig‐
672 procmask(2), sigreturn(2), sigsuspend(2), wait(2), killpg(3), raise(3),
673 siginterrupt(3), sigqueue(3), sigsetops(3), sigvec(3), core(5), sig‐
674 nal(7)
675
676
677
678Linux man-pages 6.04 2023-03-30 sigaction(2)