]>
Commit | Line | Data |
---|---|---|
c11b1abf | 1 | .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com> |
7594eb92 MK |
2 | .\" |
3 | .\" Permission is granted to make and distribute verbatim copies of this | |
4 | .\" manual provided the copyright notice and this permission notice are | |
5 | .\" preserved on all copies. | |
6 | .\" | |
7 | .\" Permission is granted to copy and distribute modified versions of this | |
8 | .\" manual under the conditions for verbatim copying, provided that the | |
9 | .\" entire resulting derived work is distributed under the terms of a | |
10 | .\" permission notice identical to this one. | |
11 | .\" | |
12 | .\" Since the Linux kernel and libraries are constantly changing, this | |
13 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
14 | .\" responsibility for errors or omissions, or for damages resulting from | |
15 | .\" the use of the information contained herein. The author(s) may not | |
16 | .\" have taken the same level of care in the production of this manual, | |
17 | .\" which is licensed free of charge, as they might when working | |
18 | .\" professionally. | |
19 | .\" | |
20 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
21 | .\" the source, must acknowledge the copyright and authors of this work. | |
22 | .\" | |
b8b64c11 | 23 | .TH SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual" |
7594eb92 MK |
24 | .SH NAME |
25 | sysv_signal \- signal handling with System V semantics | |
26 | .SH SYNOPSIS | |
27 | .B #define _GNU_SOURCE | |
28 | .br | |
29 | .B #include <signal.h> | |
30 | .sp | |
31 | .B typedef void (*sighandler_t)(int); | |
32 | .sp | |
33 | .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); | |
34 | .SH DESCRIPTION | |
35 | The | |
36 | .BR sysv_signal () | |
37 | function takes the same arguments, and performs the same task, as | |
38 | .BR signal (2). | |
39 | ||
40 | However | |
41 | .BR sysv_signal () | |
42 | provides the System V unreliable signal semantics, that is: | |
43 | a) the disposition of the signal is reset to the default | |
44 | when the handler is invoked; | |
45 | b) delivery of further instances of the signal is not blocked while | |
46 | the signal handler is executing; and | |
47 | c) if the handler interrupts (certain) blocking system calls, | |
48 | then the system call is not automatically restarted. | |
49 | .SH "RETURN VALUE" | |
50 | The | |
51 | .BR sysv_signal () | |
52 | function returns the previous value of the signal handler, or | |
53 | .B SIG_ERR | |
54 | on error. | |
55 | .SH ERRORS | |
56 | As for | |
57 | .BR signal (2). | |
2b2581ee MK |
58 | .SH "CONFORMING TO" |
59 | This function is non-standard. | |
7594eb92 MK |
60 | .SH NOTES |
61 | Use of | |
62 | .BR sysv_signal () | |
63 | should be avoided; use | |
64 | .BR sigaction (2) | |
65 | instead. | |
66 | ||
67 | On older Linux systems, | |
68 | .BR sysv_signal () | |
69 | and | |
70 | .BR signal (2) | |
71 | were equivalent. | |
988db661 | 72 | But on newer systems, |
7594eb92 MK |
73 | .BR signal (2) |
74 | provides reliable signal semantics; see | |
75 | .BR signal (2) | |
76 | for details. | |
77 | ||
78 | The use of | |
f19a0f03 | 79 | .I sighandler_t |
7594eb92 | 80 | is a GNU extension; |
988db661 | 81 | this type is only defined if |
c3dfd2c8 MK |
82 | the |
83 | .B _GNU_SOURCE | |
84 | feature test macro is defined. | |
7594eb92 MK |
85 | .SH "SEE ALSO" |
86 | .BR sigaction (2), | |
87 | .BR signal (2), | |
88 | .BR bsd_signal (3), | |
89 | .BR feature_test_macros (7), | |
90 | .BR signal (7) |