memfd_secret.2: SEE ALSO: add memfd_create(2)
[man-pages.git] / man3 / sysv_signal.3
blobed630dc2d86a1c177896f097d9a303ccbe34b440
1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH SYSV_SIGNAL 3 2021-03-22 "" "Linux Programmer's Manual"
26 .SH NAME
27 sysv_signal \- signal handling with System V semantics
28 .SH SYNOPSIS
29 .nf
30 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
31 .B #include <signal.h>
32 .PP
33 .B typedef void (*sighandler_t)(int);
34 .PP
35 .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
36 .fi
37 .SH DESCRIPTION
38 The
39 .BR sysv_signal ()
40 function takes the same arguments, and performs the same task, as
41 .BR signal (2).
42 .PP
43 However
44 .BR sysv_signal ()
45 provides the System V unreliable signal semantics, that is:
46 a) the disposition of the signal is reset to the default
47 when the handler is invoked;
48 b) delivery of further instances of the signal is not blocked while
49 the signal handler is executing; and
50 c) if the handler interrupts (certain) blocking system calls,
51 then the system call is not automatically restarted.
52 .SH RETURN VALUE
53 The
54 .BR sysv_signal ()
55 function returns the previous value of the signal handler, or
56 .B SIG_ERR
57 on error.
58 .SH ERRORS
59 As for
60 .BR signal (2).
61 .SH ATTRIBUTES
62 For an explanation of the terms used in this section, see
63 .BR attributes (7).
64 .ad l
65 .nh
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface       Attribute       Value
72 .BR sysv_signal ()
73 T}      Thread safety   MT-Safe
74 .TE
75 .hy
76 .ad
77 .sp 1
78 .SH CONFORMING TO
79 This function is nonstandard.
80 .SH NOTES
81 Use of
82 .BR sysv_signal ()
83 should be avoided; use
84 .BR sigaction (2)
85 instead.
86 .PP
87 On older Linux systems,
88 .BR sysv_signal ()
89 and
90 .BR signal (2)
91 were equivalent.
92 But on newer systems,
93 .BR signal (2)
94 provides reliable signal semantics; see
95 .BR signal (2)
96 for details.
97 .PP
98 The use of
99 .I sighandler_t
100 is a GNU extension;
101 this type is defined only if
103 .B _GNU_SOURCE
104 feature test macro is defined.
105 .SH SEE ALSO
106 .BR sigaction (2),
107 .BR signal (2),
108 .BR bsd_signal (3),
109 .BR signal (7)