SIGPAUSE(2)

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

✨ NAME ✨

okay so bestie, welcome to SIGPAUSE(2) from the System Calls Manual πŸ’… β€” this page is literally about sighold, sigignore, sigpause, sigrelse, and sigset, aka the legacy interface for signal management. No cap, we are in our vintage era.

πŸŽ€ LIBRARY πŸŽ€

Standard C Library (libc, -lc) β€” she lives in libc, periodt.

🌸 SYNOPSIS 🌸

#include <signal.h>

int
sighold(int sig);

int
sigignore(int sig);

int
xsi_sigpause(int sigmask);

int
sigrelse(int sig);

void (*)(int)
sigset(int, void (*disp)(int));

int
sigpause(int sigmask);

πŸ’– DESCRIPTION πŸ’–

🚨 bestie, real talk: this interface is made obsolete by sigsuspend(2) and sigaction(2). It’s giving β€œwe keep it for compatibility,” not β€œuse this for new code.”
  • sigset() β€” modifies signal dispositions. The sig argument specifies the signal, which may be any signal except SIGKILL and SIGSTOP. The disp argument specifies the signal’s disposition, which may be SIG_DFL, SIG_IGN, or the address of a signal handler. If sigset() is used, and disp is the address of a signal handler, the system adds sig to the signal mask of the calling process before executing the signal handler; when the signal handler returns, the system restores the signal mask of the calling process to its state prior to the delivery of the signal. In addition, if sigset() is used, and disp is equal to SIG_HOLD, sig is added to the signal mask of the calling process and sig’s disposition remains unchanged. If sigset() is used, and disp is not equal to SIG_HOLD, sig is removed from the signal mask of the calling process.
  • sighold() β€” adds sig to the signal mask of the calling process. Very β€œhold my signal” energy 🫢
  • sigrelse() β€” removes sig from the signal mask of the calling process. Release her πŸ’…
  • sigignore() β€” sets the disposition of sig to SIG_IGN. Ignore era, honestly.
  • xsi_sigpause() β€” removes sig from the signal mask of the calling process and suspends the calling process until a signal is received. It restores the signal mask of the process to its original state before returning. Yes, the docs literally say sig here β€” we are not fixing the lore 😭
  • sigpause() β€” assigns sigmask to the set of masked signals and then waits for a signal to arrive; on return the set of masked signals is restored. The sigmask argument is usually 0 to indicate that no signals are to be blocked.

πŸ’œ RETURN VALUES πŸ’œ

  • sigpause() and xsi_sigpause() always terminate by being interrupted, returning -1 with errno set to EINTR. They always dip out via interruption, no cap.
  • Upon successful completion, sigset() returns SIG_HOLD if the signal had been blocked and the signal’s previous disposition if it had not been blocked. Otherwise, SIG_ERR is returned and errno set to indicate the error.
  • For all other functions, upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error:
    • [EINVAL] β€” the sig argument is not a valid signal number.
    • [EINVAL] β€” for sigset() and sigignore() functions, an attempt was made to catch or ignore SIGKILL or SIGSTOP.

πŸ¦‹ SEE ALSO πŸ¦‹

🌈 STANDARDS 🌈

The sigpause() function is implemented for compatibility with historic 4.3BSD applications. An incompatible interface by the same name, which used a single signal number rather than a mask, was present in AT&T System V UNIX, and was copied from there into the X/Open System Interfaces (XSI) option of IEEE Std 1003.1-2001 (β€œPOSIX.1”). FreeBSD implements it under the name xsi_sigpause(). The sighold(), sigignore(), sigrelse() and sigset() functions are implemented for compatibility with System V and XSI interfaces.

⭐ HISTORY ⭐

The sigpause() function appeared in 4.2BSD and has been deprecated. All other functions appeared in FreeBSD 8.1 and were deprecated before being implemented. That’s the whole lore, bestie πŸŽ€

Debian, June 2, 1993, SIGPAUSE(2) β€” vintage footer energy, mwah πŸ’‹

πŸ“¦ 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