Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

sigsuspend - wait for signal

&pagelevel(4)&pagelevel

Syntax

#include <signal.h>

int sigsuspend(const sigset_t *sigmask); 

Description

sigsuspend() replaces the current signal mask of the process with the set of signalspointed to by sigmask and then suspends the process until delivery of a signal whose action is either to execute a signal-handling function or to terminate the process.

If the signal action is to terminate the process, then sigsuspend() will never return.

If the action is to execute a signal-handling function, the function will return on completion of the signal-handling function, with the signal mask restored to the set that existed prior to the sigsuspend() call.

It is not possible to block signals that cannot be ignored. (see signal.h). This is enforced by the system without causing an error to be indicated.

If threads are used, then the function affects the process or a thread in the following manner: sigsuspend() replaces the current signal mask of the calling thread with the signal set specified and then suspends the thread.

Return val.

-1                if an error occurs. errno is set to indicate the error.

Since sigsuspend() suspends process execution indefinitely until it is interrupted by a signal, it cannot have a return value for successful completion.

Errors

sigsuspend() will fail if:

 

EINTR

A signal is caught by the calling process, and control is returned from the signal-handling function.

 

Extension

 

EFAULT

sigmask points beyond the allocated address space of the process. (End)

See also

pause(), sigaction(), sigaddset(), sigdelset(), sigemptyset(), sigfillset(), signal.h.