SIGSETMASK(2)
β¨ SIGSETMASK(2) β¨
okay bestie so we're in the System Calls Manual section 2, and today's topic is sigsetmask, sigblock and sigmask β the little trio that messes with your current signal mask. it's giving vintage, it's giving deprecated, but we're gonna learn it anyway bc you deserve to know π
πΈ NAME πΈ
sigsetmask, sigblock β manipulate current signal mask
π LIBRARY π
Standard C Library (libc, -lc) π«Ά
β¨ SYNOPSIS β¨
#include <signal.h>
int
sigsetmask(int mask);
int
sigblock(int mask);
int
sigmask(int signum);
π DESCRIPTION π
first things first, bestie β this whole interface is made obsolete by: sigprocmask(2). so like, it still works, but the cool kids have moved on. no cap.
The sigsetmask() function sets the current signal mask to the specified mask. Signals are blocked from delivery if the corresponding bit in mask is a 1. so like, bit = 1 means "not today, signal" π«
The sigblock() function adds the signals in the specified mask to the current signal mask, rather than overwriting it as sigsetmask() does. so sigblock() is the additive queen β she stacks on top of what's already there instead of bulldozing it π
The macro sigmask() is provided to construct the mask for a given signum. it's literally just a lil helper that builds the mask for you so you don't have to do the bit math yourself π
β οΈ and here's the tea: the system quietly disallowsSIGKILLorSIGSTOPto be blocked. quietly. no error, no drama, just vibes and a silent refusal π those two are simply not blockable, periodt.
π₯ RETURN VALUES π₯
The sigblock() and sigsetmask() functions return the previous set of masked signals. so you can save it, restore it, be a responsible main character π«‘
π SEE ALSO π
π¦ HISTORY π¦
The sigsetmask() and sigblock() functions first appeared in 4.2BSD and have been deprecated. yes bestie, they're elders. iconic, but elders π
and that's the whole page!! this one's from the Debian crew, dated June 2, 1993 β so like, this manpage is older than most of the internet, and honestly? it ate. 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