NAME |LIBRARY |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |ATTRIBUTES |VERSIONS |STANDARDS |HISTORY |NOTES |SEE ALSO |COLOPHON | |
SIGSETOPS(3) Library Functions ManualSIGSETOPS(3)sigemptyset, sigfillset, sigaddset, sigdelset, sigismember - POSIX signal set operations
Standard C library (libc,-lc)
#include <signal.h>int sigemptyset(sigset_t *set);int sigfillset(sigset_t *set);int sigaddset(sigset_t *set, intsignum);int sigdelset(sigset_t *set, intsignum);int sigismember(const sigset_t *set, intsignum); Feature Test Macro Requirements for glibc (seefeature_test_macros(7)):sigemptyset(),sigfillset(),sigaddset(),sigdelset(),sigismember(): _POSIX_C_SOURCE
These functions allow the manipulation of POSIX signal sets.sigemptyset() initializes the signal set given byset to empty, with all signals excluded from the set.sigfillset() initializesset to full, including all signals.sigaddset() andsigdelset() add and delete respectively signalsignum fromset.sigismember() tests whethersignum is a member ofset. Objects of typesigset_t must be initialized by a call to eithersigemptyset() orsigfillset() before being passed to the functionssigaddset(),sigdelset(), andsigismember() or the additional glibc functions described below (sigisemptyset(),sigandset(), andsigorset()). The results are undefined if this is not done.
sigemptyset(),sigfillset(),sigaddset(), andsigdelset() return 0 on success and -1 on error.sigismember() returns 1 ifsignum is a member ofset, 0 ifsignum is not a member, and -1 on error. On error, these functions seterrno to indicate the error.
EINVALsignum is not a valid signal.
For an explanation of the terms used in this section, seeattributes(7). ┌──────────────────────────────────────┬───────────────┬─────────┐ │Interface│Attribute│Value│ ├──────────────────────────────────────┼───────────────┼─────────┤ │sigemptyset(),sigfillset(), │ Thread safety │ MT-Safe │ │sigaddset(),sigdelset(), │ │ │ │sigismember(),sigisemptyset(), │ │ │ │sigorset(),sigandset() │ │ │ └──────────────────────────────────────┴───────────────┴─────────┘
GNU If the_GNU_SOURCEfeature test macro is defined, then<signal.h> exposes three other functions for manipulating signal sets:int sigisemptyset(const sigset_t *set);int sigorset(sigset_t *dest, const sigset_t *left,const sigset_t *right);int sigandset(sigset_t *dest, const sigset_t *left,const sigset_t *right);sigisemptyset() returns 1 ifset contains no signals, and 0 otherwise.sigorset() places the union of the setsleft andright indest.sigandset() places the intersection of the setsleft andright indest. Both functions return 0 on success, and -1 on failure. These functions are nonstandard (a few other systems provide similar functions) and their use should be avoided in portable applications.
POSIX.1-2008.
POSIX.1-2001.
When creating a filled signal set, the glibcsigfillset() function does not include the two real-time signals used internally by the NPTL threading implementation. Seenptl(7) for details.
sigaction(2),sigpending(2),sigprocmask(2),sigsuspend(2)
This page is part of theman-pages (Linux kernel and C library user-space interface documentation) project. Information about the project can be found at ⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report for this manual page, see ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩. This page was obtained from the tarball man-pages-6.15.tar.gz fetched from ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on 2025-08-11. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up- to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgLinux man-pages 6.15 2025-05-17SIGSETOPS(3)Pages that refer to this page:sigaction(2), signal(2), signalfd(2), sigpending(2), sigprocmask(2), sigsuspend(2), sigwaitinfo(2), pthread_attr_setsigmask_np(3), pthread_sigmask(3), sigwait(3), nptl(7), signal(7), signal-safety(7)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |