Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sigset(3j) — Ultrix-11 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

signal(2)

sigsys(2j)

intro(3j)

tty(4)

sigset(3j)

NAME

sigset, signal, sighold, sigignore, sigrelse, sigpause − manage signals

SYNTAX

#include <signal.h>

void action();
int sig;

sigset(signo, action)
signal(signo, action)
sighold(signo)
sigignore(signofP)
sigrelse(signo)
sigpause(signo)

cc ... −ljobs

DESCRIPTION

This is a package of signal management functions to manage the signals as described in sigsys(2j).  These functions are not available in most versions of UNIX and should not be used when the mechanisms of signal(2) would suffice, as they would then impair portability.  These functions are contained in the jobs library, obtained by specifying the loader option −ljobs. 

The sigset subroutine is used to provide a default signal handler for signal sig.  This function is remembered across subsequent calls to the other functions and need not be specified again.  After sigset instances of sig will cause an interrupt to be taken at func, with the signal then held so that recursive trapping due to the signal will not occur.  During normal return from func, the routines arrange for the signal action to be restored so that subsequent signals will also trap to func.  If a non-local exit is to be taken, then sigrelse must be called to un-hold the signal action, restoring the original catch.  The func may also be specified as SIG_DFL, SIG_IGN or SIG_HOLD, as described in sigsys(2j).  The value specified on the previous call to sigset is returned.  If sigset has never been called, then the default action inherited from the system is returned. 

The signal subroutine is like sigset, but the signal will not be held when the action routine is called.  Rather, it will have reverted to SIG_DFL.  This is generally unsafe, but is included for backwards compatibility to the old signal mechanism.  It should not be used. 

The sighold and sigrelse subroutines may be used to block off sig in a piece of code where it cannot be tolerated.  After sigrelse, the catch initially set with sigset will be restored. 

The sigignore can be used to temporarily set the action for sig to ignore the signal.  If the signal had been held before the call to sigignore, any pending instance of the signal will be discarded. 

The sigpause subroutine may be used by a routine which wishes to check for some condition produced at interrupt level by the sig signal, and then to pause waiting for the condition to arise with the catch of the signal enabled.  In correct usage it must be preceded by an instance of sighold to block the signal.  The sigpause subroutine is like pause in that it will return after any signal is processed.  The usual thing to do then is to re-enable the hold with sighold, check the condition again, and sigpause again if the condition has not arisen. 

SEE ALSO

signal(2), sigsys(2j), intro(3j), tty(4)

RESTRICTIONS

The sighold and sigrelse subroutines do not nest; the first sigrelse restores the default catch. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026