]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/sysv_signal.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / sysv_signal.3
1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH SYSV_SIGNAL 3 2021-03-22 "Linux man-pages (unreleased)"
6 .SH NAME
7 sysv_signal \- signal handling with System V semantics
8 .SH LIBRARY
9 Standard C library
10 .RI ( libc ", " \-lc )
11 .SH SYNOPSIS
12 .nf
13 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
14 .B #include <signal.h>
15 .PP
16 .B typedef void (*sighandler_t)(int);
17 .PP
18 .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
19 .fi
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).
25 .PP
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.
35 .SH RETURN VALUE
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).
44 .SH ATTRIBUTES
45 For an explanation of the terms used in this section, see
46 .BR attributes (7).
47 .ad l
48 .nh
49 .TS
50 allbox;
51 lbx lb lb
52 l l l.
53 Interface Attribute Value
54 T{
55 .BR sysv_signal ()
56 T} Thread safety MT-Safe
57 .TE
58 .hy
59 .ad
60 .sp 1
61 .SH STANDARDS
62 This function is nonstandard.
63 .SH NOTES
64 Use of
65 .BR sysv_signal ()
66 should be avoided; use
67 .BR sigaction (2)
68 instead.
69 .PP
70 On older Linux systems,
71 .BR sysv_signal ()
72 and
73 .BR signal (2)
74 were equivalent.
75 But on newer systems,
76 .BR signal (2)
77 provides reliable signal semantics; see
78 .BR signal (2)
79 for details.
80 .PP
81 The use of
82 .I sighandler_t
83 is a GNU extension;
84 this type is defined only if
85 the
86 .B _GNU_SOURCE
87 feature test macro is defined.
88 .SH SEE ALSO
89 .BR sigaction (2),
90 .BR signal (2),
91 .BR bsd_signal (3),
92 .BR signal (7)