OSDN Git Service

LDP: Update original to LDP v3.76
[linuxjm/LDP_man-pages.git] / original / man2 / sigaction.2
1 '\" t
2 .\" Copyright (c) 1994,1995 Mike Battersby <mib@deakin.edu.au>
3 .\" and Copyright 2004, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" based on work by faith@cs.unc.edu
5 .\"
6 .\" %%%LICENSE_START(VERBATIM)
7 .\" Permission is granted to make and distribute verbatim copies of this
8 .\" manual provided the copyright notice and this permission notice are
9 .\" preserved on all copies.
10 .\"
11 .\" Permission is granted to copy and distribute modified versions of this
12 .\" manual under the conditions for verbatim copying, provided that the
13 .\" entire resulting derived work is distributed under the terms of a
14 .\" permission notice identical to this one.
15 .\"
16 .\" Since the Linux kernel and libraries are constantly changing, this
17 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
18 .\" responsibility for errors or omissions, or for damages resulting from
19 .\" the use of the information contained herein.  The author(s) may not
20 .\" have taken the same level of care in the production of this manual,
21 .\" which is licensed free of charge, as they might when working
22 .\" professionally.
23 .\"
24 .\" Formatted or processed versions of this manual, if unaccompanied by
25 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" %%%LICENSE_END
27 .\"
28 .\" Modified, aeb, 960424
29 .\" Modified Fri Jan 31 17:31:20 1997 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff.
31 .\" Modified Sat May  8 17:40:19 1999 by Matthew Wilcox
32 .\"     add POSIX.1b signals
33 .\" Modified Sat Dec 29 01:44:52 2001 by Evan Jones <ejones@uwaterloo.ca>
34 .\"     SA_ONSTACK
35 .\" Modified 2004-11-11 by Michael Kerrisk <mtk.manpages@gmail.com>
36 .\"     Added mention of SIGCONT under SA_NOCLDSTOP
37 .\"     Added SA_NOCLDWAIT
38 .\" Modified 2004-11-17 by Michael Kerrisk <mtk.manpages@gmail.com>
39 .\"     Updated discussion for POSIX.1-2001 and SIGCHLD and sa_flags.
40 .\"     Formatting fixes
41 .\" 2004-12-09, mtk, added SI_TKILL + other minor changes
42 .\" 2005-09-15, mtk, split sigpending(), sigprocmask(), sigsuspend()
43 .\"     out of this page into separate pages.
44 .\" 2010-06-11 Andi Kleen, add hwpoison signal extensions
45 .\" 2010-06-11 mtk, improvements to discussion of various siginfo_t fields.
46 .\"
47 .TH SIGACTION 2 2014-12-31 "Linux" "Linux Programmer's Manual"
48 .SH NAME
49 sigaction \- examine and change a signal action
50 .SH SYNOPSIS
51 .nf
52 .B #include <signal.h>
53 .sp
54 .BI "int sigaction(int " signum ", const struct sigaction *" act ,
55 .BI "              struct sigaction *" oldact );
56 .fi
57 .sp
58 .in -4n
59 Feature Test Macro Requirements for glibc (see
60 .BR feature_test_macros (7)):
61 .in
62 .sp
63 .ad l
64 .BR sigaction ():
65 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
66
67 .IR siginfo_t :
68 _POSIX_C_SOURCE >= 199309L
69 .ad b
70 .SH DESCRIPTION
71 The
72 .BR sigaction ()
73 system call is used to change the action taken by a process on
74 receipt of a specific signal.
75 (See
76 .BR signal (7)
77 for an overview of signals.)
78 .PP
79 .I signum
80 specifies the signal and can be any valid signal except
81 .B SIGKILL
82 and
83 .BR SIGSTOP .
84 .PP
85 If
86 .I act
87 is non-NULL, the new action for signal
88 .I signum
89 is installed from
90 .IR act .
91 If
92 .I oldact
93 is non-NULL, the previous action is saved in
94 .IR oldact .
95 .PP
96 The
97 .I sigaction
98 structure is defined as something like:
99 .sp
100 .in +4n
101 .nf
102 struct sigaction {
103     void     (*sa_handler)(int);
104     void     (*sa_sigaction)(int, siginfo_t *, void *);
105     sigset_t   sa_mask;
106     int        sa_flags;
107     void     (*sa_restorer)(void);
108 };
109 .fi
110 .in
111 .PP
112 On some architectures a union is involved: do not assign to both
113 .I sa_handler
114 and
115 .IR sa_sigaction .
116 .PP
117 The
118 .I sa_restorer
119 field is not intended for application use.
120 (POSIX does not specify a
121 .I sa_restorer
122 field.)
123 Some further details of purpose of this field can be found in
124 .BR sigreturn (2).
125 .PP
126 .I sa_handler
127 specifies the action to be associated with
128 .I signum
129 and may be
130 .B SIG_DFL
131 for the default action,
132 .B SIG_IGN
133 to ignore this signal, or a pointer to a signal handling function.
134 This function receives the signal number as its only argument.
135 .PP
136 If
137 .B SA_SIGINFO
138 is specified in
139 .IR sa_flags ,
140 then
141 .I sa_sigaction
142 (instead of
143 .IR sa_handler )
144 specifies the signal-handling function for
145 .IR signum .
146 This function receives the signal number as its first argument, a
147 pointer to a
148 .I siginfo_t
149 as its second argument and a pointer to a
150 .I ucontext_t
151 (cast to \fIvoid\ *\fP) as its third argument.
152 (Commonly, the handler function doesn't make any use of the third argument.
153 See
154 .BR getcontext (3)
155 for further information about
156 .IR ucontext_t .)
157 .PP
158 .I sa_mask
159 specifies a mask of signals which should be blocked
160 (i.e., added to the signal mask of the thread in which
161 the signal handler is invoked)
162 during execution of the signal handler.
163 In addition, the signal which triggered the handler
164 will be blocked, unless the
165 .B SA_NODEFER
166 flag is used.
167 .PP
168 .I sa_flags
169 specifies a set of flags which modify the behavior of the signal.
170 It is formed by the bitwise OR of zero or more of the following:
171 .RS 4
172 .TP
173 .B SA_NOCLDSTOP
174 If
175 .I signum
176 is
177 .BR SIGCHLD ,
178 do not receive notification when child processes stop (i.e., when they
179 receive one of
180 .BR SIGSTOP ", " SIGTSTP ", " SIGTTIN ", "
181 or
182 .BR SIGTTOU )
183 or resume (i.e., they receive
184 .BR SIGCONT )
185 (see
186 .BR wait (2)).
187 This flag is meaningful only when establishing a handler for
188 .BR SIGCHLD .
189 .TP
190 .BR SA_NOCLDWAIT " (since Linux 2.6)"
191 .\" To be precise: Linux 2.5.60 -- MTK
192 If
193 .I signum
194 is
195 .BR SIGCHLD ,
196 do not transform children into zombies when they terminate.
197 See also
198 .BR waitpid (2).
199 This flag is meaningful only when establishing a handler for
200 .BR SIGCHLD ,
201 or when setting that signal's disposition to
202 .BR SIG_DFL .
203
204 If the
205 .B SA_NOCLDWAIT
206 flag is set when establishing a handler for
207 .BR SIGCHLD ,
208 POSIX.1 leaves it unspecified whether a
209 .B SIGCHLD
210 signal is generated when a child process terminates.
211 On Linux, a
212 .B SIGCHLD
213 signal is generated in this case;
214 on some other implementations, it is not.
215 .TP
216 .B SA_NODEFER
217 Do not prevent the signal from being received from within its own signal
218 handler.
219 This flag is meaningful only when establishing a signal handler.
220 .B SA_NOMASK
221 is an obsolete, nonstandard synonym for this flag.
222 .TP
223 .B SA_ONSTACK
224 Call the signal handler on an alternate signal stack provided by
225 .BR sigaltstack (2).
226 If an alternate stack is not available, the default stack will be used.
227 This flag is meaningful only when establishing a signal handler.
228 .TP
229 .BR SA_RESETHAND
230 Restore the signal action to the default upon entry to the signal handler.
231 This flag is meaningful only when establishing a signal handler.
232 .B SA_ONESHOT
233 is an obsolete, nonstandard synonym for this flag.
234 .TP
235 .B SA_RESTART
236 Provide behavior compatible with BSD signal semantics by making certain
237 system calls restartable across signals.
238 This flag is meaningful only when establishing a signal handler.
239 See
240 .BR signal (7)
241 for a discussion of system call restarting.
242 .TP
243 .BR SA_RESTORER
244 .IR "Not intended for application use" .
245 This flag is used by C libraries to indicate that the
246 .IR sa_restorer
247 field contains the address of a "signal trampoline".
248 See
249 .BR sigreturn (2)
250 for more details.
251 .TP
252 .BR SA_SIGINFO " (since Linux 2.2)"
253 The signal handler takes three arguments, not one.
254 In this case,
255 .I sa_sigaction
256 should be set instead of
257 .IR sa_handler .
258 This flag is meaningful only when establishing a signal handler.
259 .\" (The
260 .\" .I sa_sigaction
261 .\" field was added in Linux 2.1.86.)
262 .RE
263 .PP
264 The
265 .I siginfo_t
266 argument to
267 .I sa_sigaction
268 is a struct with the following fields:
269 .sp
270 .in +4n
271 .nf
272 siginfo_t {
273     int      si_signo;    /* Signal number */
274     int      si_errno;    /* An errno value */
275     int      si_code;     /* Signal code */
276     int      si_trapno;   /* Trap number that caused
277                              hardware-generated signal
278                              (unused on most architectures) */
279 .\" FIXME
280 .\" The siginfo_t 'si_trapno' field seems to be used only on SPARC and Alpha;
281 .\" this page could use a little more detail on its purpose there.
282     pid_t    si_pid;      /* Sending process ID */
283     uid_t    si_uid;      /* Real user ID of sending process */
284     int      si_status;   /* Exit value or signal */
285     clock_t  si_utime;    /* User time consumed */
286     clock_t  si_stime;    /* System time consumed */
287     sigval_t si_value;    /* Signal value */
288     int      si_int;      /* POSIX.1b signal */
289     void    *si_ptr;      /* POSIX.1b signal */
290     int      si_overrun;  /* Timer overrun count; POSIX.1b timers */
291     int      si_timerid;  /* Timer ID; POSIX.1b timers */
292 .\" In the kernel: si_tid
293     void    *si_addr;     /* Memory location which caused fault */
294     long     si_band;     /* Band event (was \fIint\fP in
295                              glibc 2.3.2 and earlier) */
296     int      si_fd;       /* File descriptor */
297     short    si_addr_lsb; /* Least significant bit of address
298                              (since Linux 2.6.32) */
299 }
300 .fi
301 .in
302
303 .IR si_signo ", " si_errno " and " si_code
304 are defined for all signals.
305 .RI ( si_errno
306 is generally unused on Linux.)
307 The rest of the struct may be a union, so that one should
308 read only the fields that are meaningful for the given signal:
309 .IP * 2
310 Signals sent with
311 .BR kill (2)
312 and
313 .BR sigqueue (3)
314 fill in
315 .IR si_pid " and " si_uid .
316 In addition, signals sent with
317 .BR sigqueue (3)
318 fill in
319 .IR si_int " and " si_ptr
320 with the values specified by the sender of the signal;
321 see
322 .BR sigqueue (3)
323 for more details.
324 .IP *
325 Signals sent by POSIX.1b timers (since Linux 2.6) fill in
326 .I si_overrun
327 and
328 .IR si_timerid .
329 The
330 .I si_timerid
331 field is an internal ID used by the kernel to identify
332 the timer; it is not the same as the timer ID returned by
333 .BR timer_create (2).
334 The
335 .I si_overrun
336 field is the timer overrun count;
337 this is the same information as is obtained by a call to
338 .BR timer_getoverrun (2).
339 These fields are nonstandard Linux extensions.
340 .IP *
341 Signals sent for message queue notification (see the description of
342 .B SIGEV_SIGNAL
343 in
344 .BR mq_notify (3))
345 fill in
346 .IR si_int / si_ptr ,
347 with the
348 .I sigev_value
349 supplied to
350 .BR mq_notify (3);
351 .IR si_pid ,
352 with the process ID of the message sender; and
353 .IR si_uid ,
354 with the real user ID of the message sender.
355 .IP *
356 .B SIGCHLD
357 fills in
358 .IR si_pid ", " si_uid ", " si_status ", " si_utime ", and " si_stime ,
359 providing information about the child.
360 The
361 .I si_pid
362 field is the process ID of the child;
363 .I si_uid
364 is the child's real user ID.
365 The
366 .I si_status
367 field contains the exit status of the child (if
368 .I si_code
369 is
370 .BR CLD_EXITED ),
371 or the signal number that caused the process to change state.
372 The
373 .I si_utime
374 and
375 .I si_stime
376 contain the user and system CPU time used by the child process;
377 these fields do not include the times used by waited-for children (unlike
378 .BR getrusage (2)
379 and
380 .BR times (2)).
381 In kernels up to 2.6, and since 2.6.27, these fields report
382 CPU time in units of
383 .IR sysconf(_SC_CLK_TCK) .
384 In 2.6 kernels before 2.6.27,
385 a bug meant that these fields reported time in units
386 of the (configurable) system jiffy (see
387 .BR time (7)).
388 .\" FIXME .
389 .\" When si_utime and si_stime where originally implemented, the
390 .\" measurement unit was HZ, which was the same as clock ticks
391 .\" (sysconf(_SC_CLK_TCK)).  In 2.6, HZ became configurable, and
392 .\" was *still* used as the unit to return the info these fields,
393 .\" with the result that the field values depended on the the
394 .\" configured HZ.  Of course, the should have been measured in
395 .\" USER_HZ instead, so that sysconf(_SC_CLK_TCK) could be used to
396 .\" convert to seconds.  I have a queued patch to fix this:
397 .\" http://thread.gmane.org/gmane.linux.kernel/698061/ .
398 .\" This patch made it into 2.6.27.
399 .\" But note that these fields still don't return the times of
400 .\" waited-for children (as is done by getrusage() and times()
401 .\" and wait4()).  Solaris 8 does include child times.
402 .IP *
403 .BR SIGILL ,
404 .BR SIGFPE ,
405 .BR SIGSEGV ,
406 .BR SIGBUS ,
407 and
408 .BR SIGTRAP
409 fill in
410 .I si_addr
411 with the address of the fault.
412 .\" FIXME . SIGTRAP also sets the following for ptrace_notify() ?
413 .\"     info.si_code = exit_code;
414 .\"     info.si_pid = task_pid_vnr(current);
415 .\"     info.si_uid = current_uid();  /* Real UID */
416 On some architectures,
417 these signals also fill in the
418 .I si_trapno
419 field.
420 Some suberrors of
421 .BR SIGBUS ,
422 in particular
423 .B BUS_MCEERR_AO
424 and
425 .BR BUS_MCEERR_AR ,
426 also fill in
427 .IR si_addr_lsb .
428 This field indicates the least significant bit of the reported address
429 and therefore the extent of the corruption.
430 For example, if a full page was corrupted,
431 .I si_addr_lsb
432 contains
433 .IR log2(sysconf(_SC_PAGESIZE)) .
434 .B BUS_MCERR_*
435 and
436 .I si_addr_lsb
437 are Linux-specific extensions.
438 .IP *
439 .BR SIGIO / SIGPOLL
440 (the two names are synonyms on Linux)
441 fills in
442 .IR si_band " and " si_fd .
443 The
444 .I si_band
445 event is a bit mask containing the same values as are filled in the
446 .I revents
447 field by
448 .BR poll (2).
449 The
450 .I si_fd
451 field indicates the file descriptor for which the I/O event occurred.
452 .PP
453 .I si_code
454 is a value (not a bit mask)
455 indicating why this signal was sent.
456 The following list shows the values which can be placed in
457 .I si_code
458 for any signal, along with reason that the signal was generated.
459 .RS 4
460 .TP 15
461 .B SI_USER
462 .BR kill (2)
463 .TP
464 .B SI_KERNEL
465 Sent by the kernel.
466 .TP
467 .B SI_QUEUE
468 .BR sigqueue (3)
469 .TP
470 .B SI_TIMER
471 POSIX timer expired
472 .TP
473 .B SI_MESGQ
474 POSIX message queue state changed (since Linux 2.6.6); see
475 .BR mq_notify (3)
476 .TP
477 .B SI_ASYNCIO
478 AIO completed
479 .TP
480 .B SI_SIGIO
481 Queued
482 .B SIGIO
483 (only in kernels up to Linux 2.2; from Linux 2.4 onward
484 .BR SIGIO / SIGPOLL
485 fills in
486 .I si_code
487 as described below).
488 .TP
489 .B SI_TKILL
490 .BR tkill (2)
491 or
492 .BR tgkill (2)
493 (since Linux 2.4.19)
494 .\" SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented
495 .\" It appears to have been an idea that was tried during 2.5.6
496 .\" through to 2.5.24 and then was backed out.
497 .RE
498 .PP
499 The following values can be placed in
500 .I si_code
501 for a
502 .B SIGILL
503 signal:
504 .RS 4
505 .TP 15
506 .B ILL_ILLOPC
507 illegal opcode
508 .TP
509 .B ILL_ILLOPN
510 illegal operand
511 .TP
512 .B ILL_ILLADR
513 illegal addressing mode
514 .TP
515 .B ILL_ILLTRP
516 illegal trap
517 .TP
518 .B ILL_PRVOPC
519 privileged opcode
520 .TP
521 .B ILL_PRVREG
522 privileged register
523 .TP
524 .B ILL_COPROC
525 coprocessor error
526 .TP
527 .B ILL_BADSTK
528 internal stack error
529 .RE
530 .PP
531 The following values can be placed in
532 .I si_code
533 for a
534 .B SIGFPE
535 signal:
536 .RS 4
537 .TP 15
538 .B FPE_INTDIV
539 integer divide by zero
540 .TP
541 .B FPE_INTOVF
542 integer overflow
543 .TP
544 .B FPE_FLTDIV
545 floating-point divide by zero
546 .TP
547 .B FPE_FLTOVF
548 floating-point overflow
549 .TP
550 .B FPE_FLTUND
551 floating-point underflow
552 .TP
553 .B FPE_FLTRES
554 floating-point inexact result
555 .TP
556 .B FPE_FLTINV
557 floating-point invalid operation
558 .TP
559 .B FPE_FLTSUB
560 subscript out of range
561 .RE
562 .PP
563 The following values can be placed in
564 .I si_code
565 for a
566 .B SIGSEGV
567 signal:
568 .RS 4
569 .TP 15
570 .B SEGV_MAPERR
571 address not mapped to object
572 .TP
573 .B SEGV_ACCERR
574 invalid permissions for mapped object
575 .RE
576 .PP
577 The following values can be placed in
578 .I si_code
579 for a
580 .B SIGBUS
581 signal:
582 .RS 4
583 .TP 15
584 .B BUS_ADRALN
585 invalid address alignment
586 .TP
587 .B BUS_ADRERR
588 nonexistent physical address
589 .TP
590 .B BUS_OBJERR
591 object-specific hardware error
592 .TP
593 .BR BUS_MCEERR_AR " (since Linux 2.6.32)"
594 Hardware memory error consumed on a machine check; action required.
595 .TP
596 .BR BUS_MCEERR_AO " (since Linux 2.6.32)"
597 Hardware memory error detected in process but not consumed; action optional.
598 .RE
599 .PP
600 The following values can be placed in
601 .I si_code
602 for a
603 .B SIGTRAP
604 signal:
605 .RS 4
606 .TP 15
607 .B TRAP_BRKPT
608 process breakpoint
609 .TP
610 .B TRAP_TRACE
611 process trace trap
612 .TP
613 .BR TRAP_BRANCH " (since Linux 2.4)"
614 process taken branch trap
615 .TP
616 .BR TRAP_HWBKPT " (since Linux 2.4)"
617 hardware breakpoint/watchpoint
618 .RE
619 .PP
620 The following values can be placed in
621 .I si_code
622 for a
623 .B SIGCHLD
624 signal:
625 .RS 4
626 .TP 15
627 .B CLD_EXITED
628 child has exited
629 .TP
630 .B CLD_KILLED
631 child was killed
632 .TP
633 .B CLD_DUMPED
634 child terminated abnormally
635 .TP
636 .B CLD_TRAPPED
637 traced child has trapped
638 .TP
639 .B CLD_STOPPED
640 child has stopped
641 .TP
642 .B CLD_CONTINUED
643 stopped child has continued (since Linux 2.6.9)
644 .RE
645 .PP
646 The following values can be placed in
647 .I si_code
648 for a
649 .BR SIGIO / SIGPOLL
650 signal:
651 .RS 4
652 .TP 15
653 .B POLL_IN
654 data input available
655 .TP
656 .B POLL_OUT
657 output buffers available
658 .TP
659 .B POLL_MSG
660 input message available
661 .TP
662 .B POLL_ERR
663 I/O error
664 .TP
665 .B POLL_PRI
666 high priority input available
667 .TP
668 .B POLL_HUP
669 device disconnected
670 .RE
671 .SH RETURN VALUE
672 .BR sigaction ()
673 returns 0 on success; on error, \-1 is returned, and
674 .I errno
675 is set to indicate the error.
676 .SH ERRORS
677 .TP
678 .B EFAULT
679 .IR act " or " oldact
680 points to memory which is not a valid part of the process address space.
681 .TP
682 .B EINVAL
683 An invalid signal was specified.
684 This will also be generated if an attempt
685 is made to change the action for
686 .BR SIGKILL " or " SIGSTOP ", "
687 which cannot be caught or ignored.
688 .SH CONFORMING TO
689 POSIX.1-2001, SVr4.
690 .\" SVr4 does not document the EINTR condition.
691 .SH NOTES
692 A child created via
693 .BR fork (2)
694 inherits a copy of its parent's signal dispositions.
695 During an
696 .BR execve (2),
697 the dispositions of handled signals are reset to the default;
698 the dispositions of ignored signals are left unchanged.
699
700 According to POSIX, the behavior of a process is undefined after it
701 ignores a
702 .BR SIGFPE ,
703 .BR SIGILL ,
704 or
705 .B SIGSEGV
706 signal that was not generated by
707 .BR kill (2)
708 or
709 .BR raise (3).
710 Integer division by zero has undefined result.
711 On some architectures it will generate a
712 .B SIGFPE
713 signal.
714 (Also dividing the most negative integer by \-1 may generate
715 .BR SIGFPE .)
716 Ignoring this signal might lead to an endless loop.
717 .PP
718 POSIX.1-1990 disallowed setting the action for
719 .B SIGCHLD
720 to
721 .BR SIG_IGN .
722 POSIX.1-2001 allows this possibility, so that ignoring
723 .B SIGCHLD
724 can be used to prevent the creation of zombies (see
725 .BR wait (2)).
726 Nevertheless, the historical BSD and System\ V behaviors for ignoring
727 .B SIGCHLD
728 differ, so that the only completely portable method of ensuring that
729 terminated children do not become zombies is to catch the
730 .B SIGCHLD
731 signal and perform a
732 .BR wait (2)
733 or similar.
734 .PP
735 POSIX.1-1990 specified only
736 .BR SA_NOCLDSTOP .
737 POSIX.1-2001 added
738 .BR SA_NOCLDWAIT ,
739 .BR SA_RESETHAND ,
740 .BR SA_NODEFER ,
741 and
742 .BR SA_SIGINFO .
743 Use of these latter values in
744 .I sa_flags
745 may be less portable in applications intended for older
746 UNIX implementations.
747 .PP
748 The
749 .B SA_RESETHAND
750 flag is compatible with the SVr4 flag of the same name.
751 .PP
752 The
753 .B SA_NODEFER
754 flag is compatible with the SVr4 flag of the same name under kernels
755 1.3.9 and newer.
756 On older kernels the Linux implementation
757 allowed the receipt of any signal, not just the one we are installing
758 (effectively overriding any
759 .I sa_mask
760 settings).
761 .PP
762 .BR sigaction ()
763 can be called with a NULL second argument to query the current signal
764 handler.
765 It can also be used to check whether a given signal is valid for
766 the current machine by calling it with NULL second and third arguments.
767 .PP
768 It is not possible to block
769 .BR SIGKILL " or " SIGSTOP
770 (by specifying them in
771 .IR sa_mask ).
772 Attempts to do so are silently ignored.
773 .PP
774 See
775 .BR sigsetops (3)
776 for details on manipulating signal sets.
777 .PP
778 See
779 .BR signal (7)
780 for a list of the async-signal-safe functions that can be
781 safely called inside from inside a signal handler.
782 .SS Undocumented
783 Before the introduction of
784 .B SA_SIGINFO
785 it was also possible to get some additional information,
786 namely by using a
787 .I sa_handler
788 with second argument of type
789 .IR "struct sigcontext".
790 See the relevant Linux kernel sources for details.
791 This use is obsolete now.
792 .SH BUGS
793 In kernels up to and including 2.6.13, specifying
794 .B SA_NODEFER
795 in
796 .I sa_flags
797 prevents not only the delivered signal from being masked during
798 execution of the handler, but also the signals specified in
799 .IR sa_mask .
800 This bug was fixed in kernel 2.6.14.
801 .SH EXAMPLE
802 See
803 .BR mprotect (2).
804 .SH SEE ALSO
805 .BR kill (1),
806 .BR kill (2),
807 .BR killpg (2),
808 .BR pause (2),
809 .BR restart_syscall (2),
810 .BR sigaltstack (2),
811 .BR signal (2),
812 .BR signalfd (2),
813 .BR sigpending (2),
814 .BR sigreturn (2),
815 .BR sigprocmask (2),
816 .BR sigsuspend (2),
817 .BR wait (2),
818 .BR raise (3),
819 .BR siginterrupt (3),
820 .BR sigqueue (3),
821 .BR sigsetops (3),
822 .BR sigvec (3),
823 .BR core (5),
824 .BR signal (7)
825 .SH COLOPHON
826 This page is part of release 3.76 of the Linux
827 .I man-pages
828 project.
829 A description of the project,
830 information about reporting bugs,
831 and the latest version of this page,
832 can be found at
833 \%http://www.kernel.org/doc/man\-pages/.