1SIGSETOPS(3) Library Functions Manual SIGSETOPS(3)
2
3
4
6 sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX sig‐
7 nal set operations
8
10 Standard C library (libc, -lc)
11
13 #include <signal.h>
14
15 int sigemptyset(sigset_t *set);
16 int sigfillset(sigset_t *set);
17
18 int sigaddset(sigset_t *set, int signum);
19 int sigdelset(sigset_t *set, int signum);
20
21 int sigismember(const sigset_t *set, int signum);
22
23 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
24
25 sigemptyset(), sigfillset(), sigaddset(), sigdelset(), sigismember():
26 _POSIX_C_SOURCE
27
29 These functions allow the manipulation of POSIX signal sets.
30
31 sigemptyset() initializes the signal set given by set to empty, with
32 all signals excluded from the set.
33
34 sigfillset() initializes set to full, including all signals.
35
36 sigaddset() and sigdelset() add and delete respectively signal signum
37 from set.
38
39 sigismember() tests whether signum is a member of set.
40
41 Objects of type sigset_t must be initialized by a call to either
42 sigemptyset() or sigfillset() before being passed to the functions
43 sigaddset(), sigdelset(), and sigismember() or the additional glibc
44 functions described below (sigisemptyset(), sigandset(), and sig‐
45 orset()). The results are undefined if this is not done.
46
48 sigemptyset(), sigfillset(), sigaddset(), and sigdelset() return 0 on
49 success and -1 on error.
50
51 sigismember() returns 1 if signum is a member of set, 0 if signum is
52 not a member, and -1 on error.
53
54 On error, these functions set errno to indicate the error.
55
57 EINVAL signum is not a valid signal.
58
60 For an explanation of the terms used in this section, see at‐
61 tributes(7).
62
63 ┌────────────────────────────────────────────┬───────────────┬─────────┐
64 │Interface │ Attribute │ Value │
65 ├────────────────────────────────────────────┼───────────────┼─────────┤
66 │sigemptyset(), sigfillset(), sigaddset(), │ Thread safety │ MT-Safe │
67 │sigdelset(), sigismember(), │ │ │
68 │sigisemptyset(), sigorset(), sigandset() │ │ │
69 └────────────────────────────────────────────┴───────────────┴─────────┘
70
72 GNU
73 If the _GNU_SOURCE feature test macro is defined, then <signal.h> ex‐
74 poses three other functions for manipulating signal sets:
75
76 int sigisemptyset(const sigset_t *set);
77 int sigorset(sigset_t *dest, const sigset_t *left,
78 const sigset_t *right);
79 int sigandset(sigset_t *dest, const sigset_t *left,
80 const sigset_t *right);
81
82 sigisemptyset() returns 1 if set contains no signals, and 0 otherwise.
83
84 sigorset() places the union of the sets left and right in dest.
85 sigandset() places the intersection of the sets left and right in dest.
86 Both functions return 0 on success, and -1 on failure.
87
88 These functions are nonstandard (a few other systems provide similar
89 functions) and their use should be avoided in portable applications.
90
92 POSIX.1-2008.
93
95 POSIX.1-2001.
96
98 When creating a filled signal set, the glibc sigfillset() function does
99 not include the two real-time signals used internally by the NPTL
100 threading implementation. See nptl(7) for details.
101
103 sigaction(2), sigpending(2), sigprocmask(2), sigsuspend(2)
104
105
106
107Linux man-pages 6.04 2023-03-30 SIGSETOPS(3)