SIGSUSPEND(2,L) AIX Technical Reference SIGSUSPEND(2,L) ------------------------------------------------------------------------------- sigsuspend, sigpause PURPOSE Atomically changes the set of blocked signals and waits for an interrupt. SYNTAX #include <signal.h> int sigsuspend (sigmask) sigset_t *sigmask; DESCRIPTION The sigsuspend system call replaces the process's signal mask with the signal mask pointed to by the sigmask parameter. It then suspends execution of the process until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process. The sigsuspend system call does not allow the SIGKILL, SIGSTOP, or SIGCONT signals to be blocked. If a program attempts to block one of these signals, sigsuspend gives no indication of the error. If delivery of a signal causes the process to terminate, the sigsuspend system call does not return. If delivery of a signal causes a signal-catching function to execute, the sigsuspend system call returns after the signal-catching function returns, with the signal mask restored to the set that existed prior to the sigsuspend call. The sigsuspend system call sets the signal mask and waits for an unblocked signal as one atomic operation. This means that signals cannot occur between the operations of setting the mask and waiting for a signal. If a program invokes the sigprocmask(SIG_SETMASK,...) and pause system calls separately, a signal that occurs between these system calls might not be noticed by pause. In normal usage, a signal is blocked by using the sigprocmask(SIG_BLOCK,...) system call at the beginning of a critical section. The process then determines whether there is work for it to do. If there is no work, the process waits for work by calling sigsuspend with the mask previously returned by the sigprocmask system call. COMPATIBILITY INTERFACES int sigpause (sigmask) int sigmask; The sigpause function only allows signals with values 1-32 to be masked. Signal i is blocked if the i-th bit in the sigmask parameter is a 1. Processed November 7, 1990 SIGSUSPEND(2,L) 1
SIGSUSPEND(2,L) AIX Technical Reference SIGSUSPEND(2,L) RETURN VALUE If a signal is caught by the calling process and control is returned from the signal handler, the calling process resumes execution after the sigsuspend system call, which always returns a value of -1 and sets errno to EINTR. RELATED INFORMATION In this book: "pause," "sigaction, sigvec, signal," and "sigprocmask, sigsetmask, sigblock." Processed November 7, 1990 SIGSUSPEND(2,L) 2