1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH BSD_SIGNAL 3 2019-03-06 "" "Linux Programmer's Manual"
27 bsd_signal \- signal handling with BSD semantics
29 .B #include <signal.h>
31 .B typedef void (*sighandler_t)(int);
33 .BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler );
36 Feature Test Macro Requirements for glibc (see
37 .BR feature_test_macros (7)):
45 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
46 && ! (_POSIX_C_SOURCE\ >=\ 200809L)
48 Glibc 2.25 and earlier:
55 function takes the same arguments, and performs the same task, as
58 The difference between the two is that
60 is guaranteed to provide reliable signal semantics, that is:
61 a) the disposition of the signal is not reset to the default
62 when the handler is invoked;
63 b) delivery of further instances of the signal is blocked while
64 the signal handler is executing; and
65 c) if the handler interrupts a blocking system call,
66 then the system call is automatically restarted.
67 A portable application cannot rely on
69 to provide these guarantees.
73 function returns the previous value of the signal handler, or
80 For an explanation of the terms used in this section, see
86 Interface Attribute Value
89 T} Thread safety MT-Safe
93 POSIX.1-2008 removes the specification of
95 recommending the use of
101 should be avoided; use
105 On modern Linux systems,
110 But on older systems,
112 provided unreliable signal semantics; see
119 this type is defined only if the
121 feature test macro is defined.