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