DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

sigsuspend(S)


sigsuspend -- wait for signal(s)

Syntax

cc . . . -lc

#include  <signal.h>

int sigsuspend(const sigset_t *sigmask);

Description

A call to the sigsuspend routine replaces the process's signal mask with the signal set to which the argument sigmask points. The routine then suspends the process until it receives a signal whose associated action is to either terminate the process or execute a signal-catching function.

If the action is to execute a signal-catching function, the sigsuspend routine returns immediately after the signal-catching function does. The signal mask is restored to the value it held before the call to the sigsuspend routine. If the action calls for the termination of the process, the sigsuspend routine does not return.

As with all signal routines, un-ignorable signals cannot be blocked (see signal(S). or sigaction(S)). The system enforces this restriction without indicating an error.

Return value

Because the sigsuspend function suspends process execution indefinitely, no successful completion value is returned. A value of -1 is returned and errno is set to indicate the error.

Diagnostics

If the following condition occurs, the sigsuspend function returns -1 and sets errno to the corresponding value:


[EINTR]
A signal is caught by the calling process and control is returned from the signal-catching function.

See also

pause(S), sigaction(S), signal(M), signal(S), sigpending(S), sigprocmask(S), sigset(S), sigsetjmp(S) sigsetv(S),

Standards conformance

sigsuspend is conformant with:

IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) ;
X/Open Portability Guide, Issue 3, 1989 ;
and NIST FIPS 151-1 .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003