]>
Commit | Line | Data |
---|---|---|
c11b1abf | 1 | .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com> |
7594eb92 | 2 | .\" |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
7594eb92 | 4 | .\" |
1ae6b2c7 | 5 | .TH SYSV_SIGNAL 3 2021-03-22 GNU "Linux Programmer's Manual" |
7594eb92 MK |
6 | .SH NAME |
7 | sysv_signal \- signal handling with System V semantics | |
dd32f35e AC |
8 | .SH LIBRARY |
9 | Standard C library | |
8fc3b2cf | 10 | .RI ( libc ", " \-lc ) |
7594eb92 | 11 | .SH SYNOPSIS |
c7db92b9 | 12 | .nf |
b80f966b | 13 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
7594eb92 | 14 | .B #include <signal.h> |
68e4db0a | 15 | .PP |
7594eb92 | 16 | .B typedef void (*sighandler_t)(int); |
68e4db0a | 17 | .PP |
7594eb92 | 18 | .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler ); |
c7db92b9 | 19 | .fi |
7594eb92 MK |
20 | .SH DESCRIPTION |
21 | The | |
22 | .BR sysv_signal () | |
23 | function takes the same arguments, and performs the same task, as | |
24 | .BR signal (2). | |
847e0d88 | 25 | .PP |
7594eb92 MK |
26 | However |
27 | .BR sysv_signal () | |
28 | provides the System V unreliable signal semantics, that is: | |
29 | a) the disposition of the signal is reset to the default | |
30 | when the handler is invoked; | |
31 | b) delivery of further instances of the signal is not blocked while | |
32 | the signal handler is executing; and | |
33 | c) if the handler interrupts (certain) blocking system calls, | |
34 | then the system call is not automatically restarted. | |
47297adb | 35 | .SH RETURN VALUE |
7594eb92 MK |
36 | The |
37 | .BR sysv_signal () | |
38 | function returns the previous value of the signal handler, or | |
39 | .B SIG_ERR | |
40 | on error. | |
41 | .SH ERRORS | |
42 | As for | |
43 | .BR signal (2). | |
2b2d07c0 | 44 | .SH ATTRIBUTES |
7cd28c91 PH |
45 | For an explanation of the terms used in this section, see |
46 | .BR attributes (7). | |
c466875e MK |
47 | .ad l |
48 | .nh | |
7cd28c91 PH |
49 | .TS |
50 | allbox; | |
c466875e | 51 | lbx lb lb |
7cd28c91 PH |
52 | l l l. |
53 | Interface Attribute Value | |
54 | T{ | |
2b2d07c0 | 55 | .BR sysv_signal () |
7cd28c91 PH |
56 | T} Thread safety MT-Safe |
57 | .TE | |
c466875e MK |
58 | .hy |
59 | .ad | |
60 | .sp 1 | |
47297adb | 61 | .SH CONFORMING TO |
c8f2dd47 | 62 | This function is nonstandard. |
7594eb92 MK |
63 | .SH NOTES |
64 | Use of | |
65 | .BR sysv_signal () | |
66 | should be avoided; use | |
67 | .BR sigaction (2) | |
68 | instead. | |
847e0d88 | 69 | .PP |
7594eb92 MK |
70 | On older Linux systems, |
71 | .BR sysv_signal () | |
72 | and | |
73 | .BR signal (2) | |
74 | were equivalent. | |
988db661 | 75 | But on newer systems, |
7594eb92 MK |
76 | .BR signal (2) |
77 | provides reliable signal semantics; see | |
78 | .BR signal (2) | |
79 | for details. | |
847e0d88 | 80 | .PP |
7594eb92 | 81 | The use of |
f19a0f03 | 82 | .I sighandler_t |
7594eb92 | 83 | is a GNU extension; |
33a0ccb2 | 84 | this type is defined only if |
c3dfd2c8 MK |
85 | the |
86 | .B _GNU_SOURCE | |
87 | feature test macro is defined. | |
47297adb | 88 | .SH SEE ALSO |
7594eb92 MK |
89 | .BR sigaction (2), |
90 | .BR signal (2), | |
91 | .BR bsd_signal (3), | |
7594eb92 | 92 | .BR signal (7) |