]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/sysv_signal.3
9763be07c16d7cd021c84821ee499284a592be48
[thirdparty/man-pages.git] / man3 / sysv_signal.3
1 .\" Copyright (c) 2007 Michael Kerrisk <mtk-manpages@gmx.net>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH SYSV_SIGNAL 3 2007-05-04 "" "Linux Programmer's Manual"
24 .SH NAME
25 sysv_signal \- signal handling with System V semantics
26 .SH SYNOPSIS
27 .B #define _GNU_SOURCE
28 .br
29 .B #include <signal.h>
30 .sp
31 .B typedef void (*sighandler_t)(int);
32 .sp
33 .BI "sighandler_t sysv_signal(int " signum ", sighandler_t " handler );
34 .SH DESCRIPTION
35 The
36 .BR sysv_signal ()
37 function takes the same arguments, and performs the same task, as
38 .BR signal (2).
39
40 However
41 .BR sysv_signal ()
42 provides the System V unreliable signal semantics, that is:
43 a) the disposition of the signal is reset to the default
44 when the handler is invoked;
45 b) delivery of further instances of the signal is not blocked while
46 the signal handler is executing; and
47 c) if the handler interrupts (certain) blocking system calls,
48 then the system call is not automatically restarted.
49 .SH "RETURN VALUE"
50 The
51 .BR sysv_signal ()
52 function returns the previous value of the signal handler, or
53 .B SIG_ERR
54 on error.
55 .SH ERRORS
56 As for
57 .BR signal (2).
58 .SH "CONFORMING TO"
59 This function is non-standard.
60 .SH NOTES
61 Use of
62 .BR sysv_signal ()
63 should be avoided; use
64 .BR sigaction (2)
65 instead.
66
67 On older Linux systems,
68 .BR sysv_signal ()
69 and
70 .BR signal (2)
71 were equivalent.
72 But on newer systems,
73 .BR signal (2)
74 provides reliable signal semantics; see
75 .BR signal (2)
76 for details.
77
78 The use of
79 .B sighandler_t
80 is a GNU extension;
81 this type is only defined if
82 the _GNU_SOURCE feature test macro is defined.
83 .SH "SEE ALSO"
84 .BR sigaction (2),
85 .BR signal (2),
86 .BR bsd_signal (3),
87 .BR feature_test_macros (7),
88 .BR signal (7)