NAME |LIBRARY |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |ATTRIBUTES |STANDARDS |HISTORY |NOTES |BUGS |SEE ALSO |COLOPHON | |
sigset(3) Library Functions Manualsigset(3)sigset, sighold, sigrelse, sigignore - System V signal API
Standard C library (libc,-lc)
#include <signal.h>typedef typeof(void (int)) *sighandler_t;[[deprecated]] sighandler_t sigset(intsig, sighandler_tdisp);[[deprecated]] int sighold(intsig);[[deprecated]] int sigrelse(intsig);[[deprecated]] int sigignore(intsig); Feature Test Macro Requirements for glibc (seefeature_test_macros(7)):sigset(),sighold(),sigrelse(),sigignore(): _XOPEN_SOURCE >= 500
These functions are provided in glibc as a compatibility interface for programs that make use of the historical System V signal API. This API is obsolete: new applications should use the POSIX signal API (sigaction(2),sigprocmask(2), etc.) Thesigset() function modifies the disposition of the signalsig. Thedisp argument can be the address of a signal handler function, or one of the following constants:SIG_DFL Reset the disposition ofsig to the default.SIG_IGN Ignoresig.SIG_HOLD Addsig to the process's signal mask, but leave the disposition ofsig unchanged. Ifdisp specifies the address of a signal handler, thensig is added to the process's signal mask during execution of the handler. Ifdisp was specified as a value other thanSIG_HOLD, thensig is removed from the process's signal mask. The dispositions forSIGKILLandSIGSTOPcannot be changed. Thesighold() function addssig to the calling process's signal mask. Thesigrelse() function removessig from the calling process's signal mask. Thesigignore() function sets the disposition ofsig toSIG_IGN.
On success,sigset() returnsSIG_HOLDifsig was blocked before the call, or the signal's previous disposition if it was not blocked before the call. On error,sigset() returns -1, witherrno set to indicate the error. (But see BUGS below.) Thesighold(),sigrelse(), andsigignore() functions return 0 on success; on error, these functions return -1 and seterrno to indicate the error.
Forsigset() see the ERRORS undersigaction(2) andsigprocmask(2). Forsighold() andsigrelse() see the ERRORS undersigprocmask(2). Forsigignore(), see the errors undersigaction(2).
For an explanation of the terms used in this section, seeattributes(7). ┌──────────────────────────────────────┬───────────────┬─────────┐ │Interface│Attribute│Value│ ├──────────────────────────────────────┼───────────────┼─────────┤ │sigset(),sighold(),sigrelse(), │ Thread safety │ MT-Safe │ │sigignore() │ │ │ └──────────────────────────────────────┴───────────────┴─────────┘
POSIX.1-2008.sighandler_t GNU. POSIX.1 uses the same type but without atypedef.
glibc 2.1. SVr4, POSIX.1-2001. POSIX.1-2008 marks these functions as obsolete, recommending the use ofsigaction(2),sigprocmask(2),pthread_sigmask(3), andsigsuspend(2) instead.
Thesigset() function provides reliable signal handling semantics (as when callingsigaction(2) withsa_mask equal to 0). On System V, thesignal() function provides unreliable semantics (as when callingsigaction(2) withsa_mask equal toSA_RESETHAND |SA_NODEFER). On BSD,signal() provides reliable semantics. POSIX.1-2001 leaves these aspects ofsignal() unspecified. Seesignal(2) for further details. In order to wait for a signal, BSD and System V both provided a function namedsigpause(3), but this function has a different argument on the two systems. Seesigpause(3) for details.
Before glibc 2.2,sigset() did not unblocksig ifdisp was specified as a value other thanSIG_HOLD. Before glibc 2.5,sigset() does not correctly return the previous disposition of the signal in two cases. First, ifdisp is specified asSIG_HOLD, then a successfulsigset() always returnsSIG_HOLD. Instead, it should return the previous disposition of the signal (unless the signal was blocked, in which caseSIG_HOLD should be returned). Second, if the signal is currently blocked, then the return value of a successfulsigset() should beSIG_HOLD. Instead, the previous disposition of the signal is returned. These problems have been fixed since glibc 2.5.
kill(2),pause(2),sigaction(2),signal(2),sigprocmask(2),raise(3),sigpause(3),sigvec(3),signal(7)
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-17sigset(3)Pages that refer to this page:sigvec(3), 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. | ![]() |