SIGSETMASK(2)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

🌸 NAME 🌸

sigsetmask, sigblock β€” manipulate current signal mask. Bestie, this is the SIGSETMASK(2) page from the System Calls Manual, and we’re gonna get into the vintage signal-mask vibes πŸ’…βœ¨

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc) β€” yes, that’s the one 🫢

✨ SYNOPSIS ✨

#include <signal.h>

int
sigsetmask(int mask);

int
sigblock(int mask);

int
sigmask(int signum);

πŸ’– DESCRIPTION πŸ’–

Okay so first things first: this interface is made obsolete by sigprocmask(2). It’s giving β€œvintage icon, but we have newer tech now” 😭

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.

The sigblock() function adds the signals in the specified mask to the current signal mask, rather than overwriting it like sigsetmask() does. The way that sigblock() is additive and sigsetmask() is a full replacement? That’s the whole distinction, iykyk πŸ”₯

The macro sigmask() is provided to construct the mask for a given signum.

The system quietly disallows SIGKILL or SIGSTOP to be blocked. No cap, it just will not let those two get masked πŸ™ˆ

πŸŽ€ RETURN VALUES πŸŽ€

The sigblock() and sigsetmask() functions return the previous set of masked signals. So you get the old vibe check back in return πŸ’«

🌈 SEE ALSO 🌈

πŸ‘‘ HISTORY πŸ‘‘

The sigsetmask() and sigblock() functions first appeared in 4.2BSD and have been deprecated. Iconic behavior, honestly, but deprecated is deprecated πŸ’€


mwah πŸ’‹ β€” this page is from Debian, dated June 2, 1993, and it’s the SIGSETMASK(2) manual page. periodt πŸ¦‹

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms