SIGPAUSE(2)
β¨ 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 bysigsuspend(2)andsigaction(2). Itβs giving βwe keep it for compatibility,β not βuse this for new code.β
sigset()β modifies signal dispositions. Thesigargument specifies the signal, which may be any signal exceptSIGKILLandSIGSTOP. Thedispargument specifies the signalβs disposition, which may beSIG_DFL,SIG_IGN, or the address of a signal handler. Ifsigset()is used, anddispis the address of a signal handler, the system addssigto 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, ifsigset()is used, anddispis equal toSIG_HOLD,sigis added to the signal mask of the calling process andsigβs disposition remains unchanged. Ifsigset()is used, anddispis not equal toSIG_HOLD,sigis removed from the signal mask of the calling process.sighold()β addssigto the signal mask of the calling process. Very βhold my signalβ energy π«Άsigrelse()β removessigfrom the signal mask of the calling process. Release her πsigignore()β sets the disposition ofsigtoSIG_IGN. Ignore era, honestly.xsi_sigpause()β removessigfrom 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 saysighere β we are not fixing the lore πsigpause()β assignssigmaskto the set of masked signals and then waits for a signal to arrive; on return the set of masked signals is restored. Thesigmaskargument is usually0to indicate that no signals are to be blocked.
π RETURN VALUES π
sigpause()andxsi_sigpause()always terminate by being interrupted, returning-1witherrnoset toEINTR. They always dip out via interruption, no cap.- Upon successful completion,
sigset()returnsSIG_HOLDif the signal had been blocked and the signalβs previous disposition if it had not been blocked. Otherwise,SIG_ERRis returned anderrnoset to indicate the error. - For all other functions, upon successful completion,
0is returned. Otherwise,-1is returned anderrnois set to indicate the error:[EINVAL]β thesigargument is not a valid signal number.[EINVAL]β forsigset()andsigignore()functions, an attempt was made to catch or ignoreSIGKILLorSIGSTOP.
π¦ 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
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms