1SIGEMPTYSET(3P) POSIX Programmer's Manual SIGEMPTYSET(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 sigemptyset — initialize and empty a signal set
14
16 #include <signal.h>
17
18 int sigemptyset(sigset_t *set);
19
21 The sigemptyset() function initializes the signal set pointed to by
22 set, such that all signals defined in POSIX.1‐2008 are excluded.
23
25 Upon successful completion, sigemptyset() shall return 0; otherwise, it
26 shall return −1 and set errno to indicate the error.
27
29 No errors are defined.
30
31 The following sections are informative.
32
34 None.
35
37 None.
38
40 The implementation of the sigemptyset() (or sigfillset()) function
41 could quite trivially clear (or set) all the bits in the signal set.
42 Alternatively, it would be reasonable to initialize part of the struc‐
43 ture, such as a version field, to permit binary-compatibility between
44 releases where the size of the set varies. For such reasons, either
45 sigemptyset() or sigfillset() must be called prior to any other use of
46 the signal set, even if such use is read-only (for example, as an argu‐
47 ment to sigpending()). This function is not intended for dynamic allo‐
48 cation.
49
50 The sigfillset() and sigemptyset() functions require that the resulting
51 signal set include (or exclude) all the signals defined in this volume
52 of POSIX.1‐2008. Although it is outside the scope of this volume of
53 POSIX.1‐2008 to place this requirement on signals that are implemented
54 as extensions, it is recommended that implementation-defined signals
55 also be affected by these functions. However, there may be a good rea‐
56 son for a particular signal not to be affected. For example, blocking
57 or ignoring an implementation-defined signal may have undesirable side-
58 effects, whereas the default action for that signal is harmless. In
59 such a case, it would be preferable for such a signal to be excluded
60 from the signal set returned by sigfillset().
61
62 In early proposals there was no distinction between invalid and unsup‐
63 ported signals (the names of optional signals that were not supported
64 by an implementation were not defined by that implementation). The
65 [EINVAL] error was thus specified as a required error for invalid sig‐
66 nals. With that distinction, it is not necessary to require implementa‐
67 tions of these functions to determine whether an optional signal is
68 actually supported, as that could have a significant performance impact
69 for little value. The error could have been required for invalid sig‐
70 nals and optional for unsupported signals, but this seemed unnecessar‐
71 ily complex. Thus, the error is optional in both cases.
72
74 None.
75
77 Section 2.4, Signal Concepts, pthread_sigmask(), sigaction(),
78 sigaddset(), sigdelset(), sigfillset(), sigismember(), sigpending(),
79 sigsuspend()
80
81 The Base Definitions volume of POSIX.1‐2008, <signal.h>
82
84 Portions of this text are reprinted and reproduced in electronic form
85 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
86 -- Portable Operating System Interface (POSIX), The Open Group Base
87 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
88 cal and Electronics Engineers, Inc and The Open Group. (This is
89 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
90 event of any discrepancy between this version and the original IEEE and
91 The Open Group Standard, the original IEEE and The Open Group Standard
92 is the referee document. The original Standard can be obtained online
93 at http://www.unix.org/online.html .
94
95 Any typographical or formatting errors that appear in this page are
96 most likely to have been introduced during the conversion of the source
97 files to man page format. To report such errors, see https://www.ker‐
98 nel.org/doc/man-pages/reporting_bugs.html .
99
100
101
102IEEE/The Open Group 2013 SIGEMPTYSET(3P)