DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sigsuspend(S-osr5)


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-osr5). or sigaction(S-osr5)). 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-osr5), sigaction(S-osr5), signal(M), signal(S-osr5), sigpending(S-osr5), sigprocmask(S-osr5), sigset(S-osr5), sigsetjmp(S-osr5) sigsetv(S-osr5),

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 .


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005