1SIGSET(3) Linux Programmer's Manual SIGSET(3)
2
3
4
6 sigset, sighold, sigrelse, sigignore - System V signal API
7
9 #include <signal.h>
10
11 typedef void (*sighandler_t)(int);
12
13 sighandler_t sigset(int sig, sighandler_t disp);
14
15 int sighold(int sig);
16 int sigrelse(int sig);
17 int sigignore(int sig);
18
19 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
20
21 sigset(), sighold(), sigrelse(), sigignore():
22 _XOPEN_SOURCE >= 500
23
25 These functions are provided in glibc as a compatibility interface for
26 programs that make use of the historical System V signal API. This API
27 is obsolete: new applications should use the POSIX signal API (sigac‐
28 tion(2), sigprocmask(2), etc.)
29
30 The sigset() function modifies the disposition of the signal sig. The
31 disp argument can be the address of a signal handler function, or one
32 of the following constants:
33
34 SIG_DFL
35 Reset the disposition of sig to the default.
36
37 SIG_IGN
38 Ignore sig.
39
40 SIG_HOLD
41 Add sig to the process's signal mask, but leave the disposition
42 of sig unchanged.
43
44 If disp specifies the address of a signal handler, then sig is added to
45 the process's signal mask during execution of the handler.
46
47 If disp was specified as a value other than SIG_HOLD, then sig is re‐
48 moved from the process's signal mask.
49
50 The dispositions for SIGKILL and SIGSTOP cannot be changed.
51
52 The sighold() function adds sig to the calling process's signal mask.
53
54 The sigrelse() function removes sig from the calling process's signal
55 mask.
56
57 The sigignore() function sets the disposition of sig to SIG_IGN.
58
60 On success, sigset() returns SIG_HOLD if sig was blocked before the
61 call, or the signal's previous disposition if it was not blocked before
62 the call. On error, sigset() returns -1, with errno set to indicate
63 the error. (But see BUGS below.)
64
65 The sighold(), sigrelse(), and sigignore() functions return 0 on suc‐
66 cess; on error, these functions return -1 and set errno to indicate the
67 error.
68
70 For sigset() see the ERRORS under sigaction(2) and sigprocmask(2).
71
72 For sighold() and sigrelse() see the ERRORS under sigprocmask(2).
73
74 For sigignore(), see the errors under sigaction(2).
75
77 For an explanation of the terms used in this section, see at‐
78 tributes(7).
79
80 ┌────────────────────────────────────────────┬───────────────┬─────────┐
81 │Interface │ Attribute │ Value │
82 ├────────────────────────────────────────────┼───────────────┼─────────┤
83 │sigset(), sighold(), sigrelse(), │ Thread safety │ MT-Safe │
84 │sigignore() │ │ │
85 └────────────────────────────────────────────┴───────────────┴─────────┘
86