The simple way to wait until a signal arrives is to call
Please read about its disadvantages, in the following section, before
you use it.
pausefunction suspends program execution until a signal arrives whose action is either to execute a handler function, or to terminate the process.
If the signal causes a handler function to be executed, then
pause returns. This is considered an unsuccessful return (since
"successful" behavior would be to suspend the program forever), so the
return value is
-1. Even if you specify that other primitives
should resume when a system handler returns (see section Primitives Interrupted by Signals), this has no effect on
pause; it always fails when a
signal is handled.
errno error conditions are defined for this function:
If the signal causes program termination,
pause doesn't return
pause function is declared in `unistd.h'.
Go to the first, previous, next, last section, table of contents.