DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sigsuspend(S)


sigsuspend -- install a signal mask and suspend process until signal

Synopsis

   #include <signal.h>
   

int sigsuspend(const sigset_t *set);

Description

sigsuspend replaces the process's signal mask with the set of signals pointed to by the argument set and then suspends the process until delivery of a signal whose action is either to execute a signal catching function or to terminate the process.

If the action is to terminate the process, sigsuspend does not return. If the action is to execute a signal catching function, sigsuspend returns after the signal catching function returns. On return, the signal mask is restored to the set that existed before the call to sigsuspend.

It is not possible to block those signals that cannot be ignored [see signal(M)]; this restriction is silently imposed by the system.

Return values

Because sigsuspend suspends process execution indefinitely, there is no successful return value. On failure, sigsuspend returns -1 and sets errno to identify the error.

Errors

In the following conditions, sigsuspend fails and sets errno to:

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

EFAULT
The set argument points outside the process's allocated address space.

References

sigaction(S), signal(M) sigpause(S), sigprocmask(S), sigsetops(S)

Notices

Considerations for threads programming

In multithreaded programs, signal masks are defined per thread. See signal(M) for further details.

While one thread is blocked, siblings might still be executing.

Considerations for lightweight processes

Internally, there is one signal mask is per LWP. The Threads Library has a wrapper function for this system call to give every thread a signal mask.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005