1 .\" Copyright (c) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH BSD_SIGNAL 3 2021-03-22 "" "Linux Programmer's Manual"
7 bsd_signal \- signal handling with BSD semantics
10 .RI ( libc ", " \-lc )
13 .B #include <signal.h>
15 .B typedef void (*sighandler_t)(int);
17 .BI "sighandler_t bsd_signal(int " signum ", sighandler_t " handler );
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
29 .\" || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
30 && ! (_POSIX_C_SOURCE >= 200809L)
31 Glibc 2.25 and earlier:
37 function takes the same arguments, and performs the same task, as
40 The difference between the two is that
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
51 to provide these guarantees.
55 function returns the previous value of the signal handler, or
62 For an explanation of the terms used in this section, see
70 Interface Attribute Value
73 T} Thread safety MT-Safe
80 POSIX.1-2008 removes the specification of
82 recommending the use of
88 should be avoided; use
92 On modern Linux systems,
99 provided unreliable signal semantics; see
106 this type is defined only if the
108 feature test macro is defined.