1sysv_signal(3) Library Functions Manual sysv_signal(3)
2
3
4
6 sysv_signal - signal handling with System V semantics
7
9 Standard C library (libc, -lc)
10
12 #define _GNU_SOURCE /* See feature_test_macros(7) */
13 #include <signal.h>
14
15 typedef void (*sighandler_t)(int);
16
17 sighandler_t sysv_signal(int signum, sighandler_t handler);
18
20 The sysv_signal() function takes the same arguments, and performs the
21 same task, as signal(2).
22
23 However sysv_signal() provides the System V unreliable signal seman‐
24 tics, that is: a) the disposition of the signal is reset to the default
25 when the handler is invoked; b) delivery of further instances of the
26 signal is not blocked while the signal handler is executing; and c) if
27 the handler interrupts (certain) blocking system calls, then the system
28 call is not automatically restarted.
29
31 The sysv_signal() function returns the previous value of the signal
32 handler, or SIG_ERR on error.
33
35 As for signal(2).
36
38 For an explanation of the terms used in this section, see at‐
39 tributes(7).
40
41 ┌────────────────────────────────────────────┬───────────────┬─────────┐
42 │Interface │ Attribute │ Value │
43 ├────────────────────────────────────────────┼───────────────┼─────────┤
44 │sysv_signal() │ Thread safety │ MT-Safe │
45 └────────────────────────────────────────────┴───────────────┴─────────┘
46
48 Use of sysv_signal() should be avoided; use sigaction(2) instead.
49
50 On older Linux systems, sysv_signal() and signal(2) were equivalent.
51 But on newer systems, signal(2) provides reliable signal semantics; see
52 signal(2) for details.
53
54 The use of sighandler_t is a GNU extension; this type is defined only
55 if the _GNU_SOURCE feature test macro is defined.
56
58 None.
59
61 sigaction(2), signal(2), bsd_signal(3), signal(7)
62
63
64
65Linux man-pages 6.05 2023-07-20 sysv_signal(3)