]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sysv_signal.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / sysv_signal.3
CommitLineData
c11b1abf 1.\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
7594eb92 2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
7594eb92 4.\"
45186a5d 5.TH SYSV_SIGNAL 3 2021-03-22 "Linux man-pages (unreleased)"
7594eb92
MK
6.SH NAME
7sysv_signal \- signal handling with System V semantics
dd32f35e
AC
8.SH LIBRARY
9Standard 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
21The
22.BR sysv_signal ()
23function takes the same arguments, and performs the same task, as
24.BR signal (2).
847e0d88 25.PP
7594eb92
MK
26However
27.BR sysv_signal ()
28provides the System V unreliable signal semantics, that is:
29a) the disposition of the signal is reset to the default
30when the handler is invoked;
31b) delivery of further instances of the signal is not blocked while
32the signal handler is executing; and
33c) if the handler interrupts (certain) blocking system calls,
34then the system call is not automatically restarted.
47297adb 35.SH RETURN VALUE
7594eb92
MK
36The
37.BR sysv_signal ()
38function returns the previous value of the signal handler, or
39.B SIG_ERR
40on error.
41.SH ERRORS
42As for
43.BR signal (2).
2b2d07c0 44.SH ATTRIBUTES
7cd28c91
PH
45For 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
50allbox;
c466875e 51lbx lb lb
7cd28c91
PH
52l l l.
53Interface Attribute Value
54T{
2b2d07c0 55.BR sysv_signal ()
7cd28c91
PH
56T} Thread safety MT-Safe
57.TE
c466875e
MK
58.hy
59.ad
60.sp 1
3113c7f3 61.SH STANDARDS
c8f2dd47 62This function is nonstandard.
7594eb92
MK
63.SH NOTES
64Use of
65.BR sysv_signal ()
66should be avoided; use
67.BR sigaction (2)
68instead.
847e0d88 69.PP
7594eb92
MK
70On older Linux systems,
71.BR sysv_signal ()
72and
73.BR signal (2)
74were equivalent.
988db661 75But on newer systems,
7594eb92
MK
76.BR signal (2)
77provides reliable signal semantics; see
78.BR signal (2)
79for details.
847e0d88 80.PP
7594eb92 81The use of
f19a0f03 82.I sighandler_t
7594eb92 83is a GNU extension;
33a0ccb2 84this type is defined only if
c3dfd2c8
MK
85the
86.B _GNU_SOURCE
87feature 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)