SIGPROCMASK(2)
π sigprocmask(2) β the system calls manual, bestie edition
okay so this is a page from the System Calls Manual (section 2, iykyk) and it's all about sigprocmask π
β¨ NAME β¨
sigprocmask β manipulate current signal mask
π LIBRARY π
Standard C Library (libc, -lc)
πΈ SYNOPSIS πΈ
#include <signal.h>
int
sigprocmask(int how, const sigset_t * restrict set,
sigset_t * restrict oset);
π DESCRIPTION π
so the sigprocmask() system call literally examines and/or changes the current signal mask β that's the lil set of signals that are blocked from delivery π. A signal is blocked if it's a member of the current signal mask set. that's it, that's the vibe.
If set is not null, what sigprocmask() actually does depends on the value of the how argument. The signal mask gets changed as a function of the specified set and the current mask. You pick the function with how, using one of these values from <signal.h>:
SIG_BLOCKβ the new mask is the union of the current mask and the specifiedset. (adding stuff to the blocklist, main character behaviour π«Ά)SIG_UNBLOCKβ the new mask is the intersection of the current mask and the complement of the specifiedset. (unblocking, we love a glow-up β¨)SIG_SETMASKβ the current mask is replaced by the specifiedset. full replacement, no notes π₯
If oset is not null, it gets set to the previous value of the signal mask. And when set is null, the value of how is insignificant and the mask remains unset β which gives you a way to examine the signal mask without modifying it. peek but don't touch, we stan π
The system quietly disallowsSIGKILLorSIGSTOPto be blocked. no cap. those two are simply not blockable, periodt.
β οΈ In threaded applications,pthread_sigmask(3)must be used instead ofsigprocmask(). like, must must. don't come crying to me π
π¦ RETURN VALUES π¦
The sigprocmask() function returns the value 0 if successful π; otherwise the value -1 is returned and the global variable errno is set to indicate the error π.
β ERRORS β
The sigprocmask() system call will fail and the signal mask will be unchanged if one of the following occurs:
[EINVAL]β thehowargument has a value other than those listed here. (bestie. you had three options. three. π)
π SEE ALSO π
kill(2), sigaction(2), sigpending(2), sigsuspend(2), fpsetmask(3), pthread_sigmask(3), sigsetops(3)
π STANDARDS π
The sigprocmask() system call is expected to conform to ISO/IEC 9945-1:1990 (βPOSIX.1β). certified iconic, compliant, and unbothered β¨
and that's the whole page, bestie π this one's from the Debian fam, dated May 7, 2010 β so yes she's a little vintage, but she still serves. mwah π π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms