1SIGEMPTYSET(P)             POSIX Programmer's Manual            SIGEMPTYSET(P)
2
3
4

NAME

6       sigemptyset - initialize and empty a signal set
7

SYNOPSIS

9       #include <signal.h>
10
11       int sigemptyset(sigset_t *set);
12
13

DESCRIPTION

15       The  sigemptyset()  function  initializes  the signal set pointed to by
16       set,  such  that  all  signals  defined  in  IEEE Std 1003.1-2001   are
17       excluded.
18

RETURN VALUE

20       Upon successful completion, sigemptyset() shall return 0; otherwise, it
21       shall return -1 and set errno to indicate the error.
22

ERRORS

24       No errors are defined.
25
26       The following sections are informative.
27

EXAMPLES

29       None.
30

APPLICATION USAGE

32       None.
33

RATIONALE

35       The implementation of  the  sigemptyset()  (or  sigfillset())  function
36       could  quite  trivially  clear (or set) all the bits in the signal set.
37       Alternatively, it would be reasonable to initialize part of the  struc‐
38       ture,  such  as a version field, to permit binary-compatibility between
39       releases where the size of the set varies.  For  such  reasons,  either
40       sigemptyset()  or sigfillset() must be called prior to any other use of
41       the signal set, even if such use is read-only (for example, as an argu‐
42       ment  to sigpending()). This function is not intended for dynamic allo‐
43       cation.
44
45       The sigfillset() and sigemptyset() functions require that the resulting
46       signal  set include (or exclude) all the signals defined in this volume
47       of IEEE Std 1003.1-2001. Although it is outside the scope of this  vol‐
48       ume  of  IEEE Std 1003.1-2001 to place this requirement on signals that
49       are implemented as extensions, it is recommended  that  implementation-
50       defined signals also be affected by these functions. However, there may
51       be a good reason for a particular signal not to be affected. For  exam‐
52       ple,  blocking  or  ignoring  an implementation-defined signal may have
53       undesirable side effects, whereas the default action for that signal is
54       harmless.   In such a case, it would be preferable for such a signal to
55       be excluded from the signal set returned by sigfillset().
56
57       In early proposals there was no distinction between invalid and  unsup‐
58       ported  signals  (the names of optional signals that were not supported
59       by an implementation were not defined  by  that  implementation).   The
60       [EINVAL]  error was thus specified as a required error for invalid sig‐
61       nals. With that distinction, it is not necessary to require implementa‐
62       tions  of  these  functions  to determine whether an optional signal is
63       actually supported, as that could have a significant performance impact
64       for  little  value. The error could have been required for invalid sig‐
65       nals and optional for unsupported signals, but this seemed  unnecessar‐
66       ily complex. Thus, the error is optional in both cases.
67

FUTURE DIRECTIONS

69       None.
70

SEE ALSO

72       Signal  Concepts  ,  sigaction()  ,  sigaddset()  ,  sigdelset() , sig‐
73       fillset() , sigismember() , sigpending() , sigprocmask() , sigsuspend()
74       , the Base Definitions volume of IEEE Std 1003.1-2001, <signal.h>
75
77       Portions  of  this text are reprinted and reproduced in electronic form
78       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
79       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
80       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
81       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
82       event of any discrepancy between this version and the original IEEE and
83       The  Open Group Standard, the original IEEE and The Open Group Standard
84       is the referee document. The original Standard can be  obtained  online
85       at http://www.opengroup.org/unix/online.html .
86
87
88
89IEEE/The Open Group                  2003                       SIGEMPTYSET(P)
Impressum