]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/bsd_signal.3
Removed out-of-date FIXME
[thirdparty/man-pages.git] / man3 / bsd_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 BSD_SIGNAL 2 2007-05-04 "" "Linux Programmer's Manual"
24 .SH NAME
25 bsd_signal \- signal handling with BSD semantics
26 .SH SYNOPSIS
27 .B #define _XOPEN_SOURCE
28 .br
29 .B #include <signal.h>
30 .sp
31 .B typedef void (*sighandler_t)(int);
32 .sp
33 .BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler );
34 .SH DESCRIPTION
35 The
36 .BR bsd_signal ()
37 function takes the same arguments, and performs the same task, as
38 .BR signal (2).
39
40 The difference between the two is that
41 .BR bsd_signal ()
42 is guaranteed to provide reliable signal semantics, that is:
43 a) the disposition of the signal is not reset to the default
44 when the handler is invoked;
45 b) delivery of further instances of the signal is blocked while
46 the signal handler is executing; and
47 c) if the handler interrupts a blocking system call,
48 then the system call is automatically restarted.
49 A portable application cannot rely on
50 .BR signal (2)
51 to provide these guarantees.
52 .SH "RETURN VALUE"
53 The
54 .BR bsd_signal ()
55 function returns the previous value of the signal handler, or
56 .B SIG_ERR
57 on error.
58 .SH ERRORS
59 As for
60 .BR signal (2).
61 .SH NOTES
62 Use of
63 .BR bsd_signal ()
64 should be avoided; use
65 .BR sigaction (2)
66 instead.
67
68 On modern Linux systems,
69 .BR bsd_signal ()
70 and
71 .BR signal (2)
72 are equivalent.
73 But on older systems,
74 .BR signal (2)
75 provided unreliable signal semantics; see
76 .BR signal (2)
77 for details.
78
79 The use of
80 .B sighandler_t
81 is a GNU extension;
82 this type is only defined if
83 the _GNU_SOURCE feature test macro is defined.
84 .SH "CONFORMING TO"
85 4.2BSD, POSIX.1-2001.
86 .SH "SEE ALSO"
87 .BR sigaction (2),
88 .BR signal (2),
89 .BR sysv_signal (3),
90 .BR feature_test_macros (7),
91 .BR signal (7)