sigpause() — Unblock a signal and wait for a signal
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2
Single UNIX Specification, Version 3 |
both | POSIX(ON)
|
Format
#define _XOPEN_SOURCE_EXTENDED 1
#include <signal.h>
int sigpause(int sig);
General description
The sigpause() function provides a simplified method for removing a signal, specified by the argument sig, from the calling thread's signal mask and suspending this thread until a signal is received whose action is either to execute a signal catcher function or to terminate the process.
Usage notes
The use of the SIGTHSTOP
and SIGTHCONT
signal
is not supported with this function.
Returned value
If successful, sigpause() returns -1 and sets errno to EINTR.
If unsuccessful, sigpause()
returns -1 and sets errno to one of the following values:
- Error Code
- Description
- EINVAL
- The value of the argument sig is not a valid signal type or it is SIGKILL, or SIGTRACE.