sigset(3)
π sigset(3) β the System V signal API, bestie edition π
okay so. this is the man page for sigset, sighold, sigrelse and sigignore, and it lives in section 3 of the manual (that's the (3) on the end of sigset(3), mwah). fair warning before we even start: this whole squad is old old, like, they're the System V signal era, and they're marked deprecated with a capital D. but you asked, so let's get into it π«Ά
β¨ NAME β¨
sigset, sighold, sigrelse, sigignore β the System V signal API
π LIBRARY π
Standard C library (libc, -lc)
π SYNOPSIS π
#include <signal.h>
typedef typeof(void (int)) *sighandler_t;
[[deprecated]] sighandler_t sigset(int sig, sighandler_t disp);
[[deprecated]] int sighold(int sig);
[[deprecated]] int sigrelse(int sig);
[[deprecated]] int sigignore(int sig);
πΈ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) πΈ
sigset(),sighold(),sigrelse(),sigignore():_XOPEN_SOURCE >= 500
π DESCRIPTION π
so glibc keeps these around purely as a compatibility interface for programs that use the historical System V signal API. like, it's there so your fossil program still runs, not because anyone wants you to write new stuff with it. this API is obsolete β new applications should be using the POSIX signal API instead: sigaction(2), sigprocmask(2), etc. no cap, that's literally what the page says.
sigset() modifies the disposition of the signal sig. the disp argument can be the address of a signal handler function, or one of these iconic constants:
SIG_DFLβ reset the disposition ofsigto the default. back to factory settings, we love a fresh start π«SIG_IGNβ ignoresig. not me pretending i don't see it πSIG_HOLDβ addsigto the process's signal mask, but leave the disposition ofsigunchanged. so it's held, not changed, and those are two different things bestie!!
if disp specifies the address of a signal handler, then sig is added to the process's signal mask during execution of the handler.
if disp was specified as a value other than SIG_HOLD, then sig is removed from the process's signal mask.
the dispositions for SIGKILL and SIGSTOP cannot be changed. periodt. don't even try it π
sighold() adds sig to the calling process's signal mask.
sigrelse() removes sig from the calling process's signal mask.
sigignore() sets the disposition of sig to SIG_IGN.
π₯ RETURN VALUE π₯
on success, sigset() returns SIG_HOLD if sig was blocked before the call, or the signal's previous disposition if it was not blocked before the call. on error, sigset() returns -1, with errno set to indicate the error. (but bestieβ¦ see BUGS below. π)
sighold(), sigrelse(), and sigignore() return 0 on success; on error, these functions return -1 and set errno to indicate the error.
π ERRORS π
- For
sigset()see the ERRORS undersigaction(2)andsigprocmask(2). - For
sighold()andsigrelse()see the ERRORS undersigprocmask(2). - For
sigignore(), see the errors undersigaction(2).
π ATTRIBUTES π
for an explanation of the terms used in this section, see attributes(7).
sigset(),sighold(),sigrelse(),sigignore()β Thread safety: MT-Safe
(that's the whole table, she's small but she's mighty π§)
π STANDARDS π
POSIX.1-2008.
sighandler_t β GNU. POSIX.1 uses the same type but without a typedef.
π HISTORY π
glibc 2.1. SVr4, POSIX.1-2001. POSIX.1-2008 marks these functions as obsolete, recommending the use of sigaction(2), sigprocmask(2), pthread_sigmask(3), and sigsuspend(2) instead. the council has spoken π
π¦ NOTES π¦
the sigset() function provides reliable signal handling semantics (as when calling sigaction(2) with sa_mask equal to 0).
on System V, the signal() function provides unreliable semantics (as when calling sigaction(2) with sa_mask equal to SA_RESETHAND | SA_NODEFER). on BSD, signal() provides reliable semantics. POSIX.1-2001 leaves these aspects of signal() unspecified. see signal(2) for further details.
in order to wait for a signal, BSD and System V both provided a function named sigpause(3), but this function has a different argument on the two systems. see sigpause(3) for details. same name, different vibe, chaos honestly π΅π«
π BUGS π
before glibc 2.2, sigset() did not unblock sig if disp was specified as a value other than SIG_HOLD.
before glibc 2.5, sigset() does not correctly return the previous disposition of the signal in two cases. first, if disp is specified as SIG_HOLD, then a successful sigset() always returns SIG_HOLD. instead, it should return the previous disposition of the signal (unless the signal was blocked, in which case SIG_HOLD should be returned). second, if the signal is currently blocked, then the return value of a successful sigset() should be SIG_HOLD. instead, the previous disposition of the signal is returned. these problems have been fixed since glibc 2.5. so if you're on anything modern you're fine, but if you're time-travelling, beware β οΈ
π SEE ALSO π
kill(2), pause(2), sigaction(2), signal(2), sigprocmask(2), raise(3), sigpause(3), sigvec(3), signal(7)
okay that's the whole page, you ate that π this was sigset(3) from Linux man-pages 6.20, dated 2026-02-08 β go forth, use sigaction(2) instead, and slay π
β¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2005, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms