]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sysv_signal.3
prctl.2: Clarify the unsupported hardware case of EINVAL
[thirdparty/man-pages.git] / man3 / sysv_signal.3
CommitLineData
c11b1abf 1.\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
7594eb92 2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
7594eb92
MK
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.
4b72fb64 23.\" %%%LICENSE_END
7594eb92 24.\"
4b8c67d9 25.TH SYSV_SIGNAL 3 2017-09-15 "" "Linux Programmer's Manual"
7594eb92
MK
26.SH NAME
27sysv_signal \- signal handling with System V semantics
28.SH SYNOPSIS
b80f966b 29.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
7594eb92
MK
30.br
31.B #include <signal.h>
68e4db0a 32.PP
7594eb92 33.B typedef void (*sighandler_t)(int);
68e4db0a 34.PP
7594eb92
MK
35.BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
36.SH DESCRIPTION
37The
38.BR sysv_signal ()
39function takes the same arguments, and performs the same task, as
40.BR signal (2).
847e0d88 41.PP
7594eb92
MK
42However
43.BR sysv_signal ()
44provides the System V unreliable signal semantics, that is:
45a) the disposition of the signal is reset to the default
46when the handler is invoked;
47b) delivery of further instances of the signal is not blocked while
48the signal handler is executing; and
49c) if the handler interrupts (certain) blocking system calls,
50then the system call is not automatically restarted.
47297adb 51.SH RETURN VALUE
7594eb92
MK
52The
53.BR sysv_signal ()
54function returns the previous value of the signal handler, or
55.B SIG_ERR
56on error.
57.SH ERRORS
58As for
59.BR signal (2).
2b2d07c0 60.SH ATTRIBUTES
7cd28c91
PH
61For an explanation of the terms used in this section, see
62.BR attributes (7).
63.TS
64allbox;
65lb lb lb
66l l l.
67Interface Attribute Value
68T{
2b2d07c0 69.BR sysv_signal ()
7cd28c91
PH
70T} Thread safety MT-Safe
71.TE
47297adb 72.SH CONFORMING TO
c8f2dd47 73This function is nonstandard.
7594eb92
MK
74.SH NOTES
75Use of
76.BR sysv_signal ()
77should be avoided; use
78.BR sigaction (2)
79instead.
847e0d88 80.PP
7594eb92
MK
81On older Linux systems,
82.BR sysv_signal ()
83and
84.BR signal (2)
85were equivalent.
988db661 86But on newer systems,
7594eb92
MK
87.BR signal (2)
88provides reliable signal semantics; see
89.BR signal (2)
90for details.
847e0d88 91.PP
7594eb92 92The use of
f19a0f03 93.I sighandler_t
7594eb92 94is a GNU extension;
33a0ccb2 95this type is defined only if
c3dfd2c8
MK
96the
97.B _GNU_SOURCE
98feature test macro is defined.
47297adb 99.SH SEE ALSO
7594eb92
MK
100.BR sigaction (2),
101.BR signal (2),
102.BR bsd_signal (3),
7594eb92 103.BR signal (7)