share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man3 / sysv_signal.3
blobd942ad751846727567f098f05322552f8cfdc88b
1 '\" t
2 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH sysv_signal 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 sysv_signal \- signal handling with System V semantics
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
15 .B #include <signal.h>
17 .B typedef void (*sighandler_t)(int);
19 .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
20 .fi
21 .SH DESCRIPTION
22 The
23 .BR sysv_signal ()
24 function takes the same arguments, and performs the same task, as
25 .BR signal (2).
27 However
28 .BR sysv_signal ()
29 provides the System V unreliable signal semantics, that is:
30 a) the disposition of the signal is reset to the default
31 when the handler is invoked;
32 b) delivery of further instances of the signal is not blocked while
33 the signal handler is executing; and
34 c) if the handler interrupts (certain) blocking system calls,
35 then the system call is not automatically restarted.
36 .SH RETURN VALUE
37 The
38 .BR sysv_signal ()
39 function returns the previous value of the signal handler, or
40 .B SIG_ERR
41 on error.
42 .SH ERRORS
43 As for
44 .BR signal (2).
45 .SH ATTRIBUTES
46 For an explanation of the terms used in this section, see
47 .BR attributes (7).
48 .TS
49 allbox;
50 lbx lb lb
51 l l l.
52 Interface       Attribute       Value
54 .na
55 .nh
56 .BR sysv_signal ()
57 T}      Thread safety   MT-Safe
58 .TE
59 .SH VERSIONS
60 Use of
61 .BR sysv_signal ()
62 should be avoided; use
63 .BR sigaction (2)
64 instead.
66 On older Linux systems,
67 .BR sysv_signal ()
68 and
69 .BR signal (2)
70 were equivalent.
71 But on newer systems,
72 .BR signal (2)
73 provides reliable signal semantics; see
74 .BR signal (2)
75 for details.
77 The use of
78 .I sighandler_t
79 is a GNU extension;
80 this type is defined only if
81 the
82 .B _GNU_SOURCE
83 feature test macro is defined.
84 .SH STANDARDS
85 None.
86 .SH SEE ALSO
87 .BR sigaction (2),
88 .BR signal (2),
89 .BR bsd_signal (3),
90 .BR signal (7)