sigmask
Sigmask is a macro found in some Unix-like systems that produces a bit mask for a given signal number. It is part of the older signal handling interface and is mainly encountered in legacy code or systems that provide compatibility with early Unix APIs. The concept behind sigmask is to map a signal’s numeric identifier to a single bit in a process-wide mask used to control delivery of signals.
In many implementations, sigmask is defined in signal.h as a bit-shift expression, typically something like a
Historically, programs constructed a mask for a set of signals using sigmask and then used functions such
Modern practice favors POSIX signal handling, which uses sigset_t objects and functions like sigemptyset, sigaddset, and
If sigmask appears in code today, it is usually advisable to rewrite using sigset_t and sigprocmask, though