United States-English |
|
|
HP-UX Reference > Ssigpause(3C)HP-UX 11i Version 3: February 2007 |
|
NAMEsigpause — signal management DESCRIPTIONThe sigpause() function, along with the sighold(), sigignore(), sigrelse(), and sigset() functions provide simplified signal management. The sigpause() function removes sig from the calling thread's signal mask and suspends the calling thread until a signal is received. The sigpause() function restores the thread's signal mask to its original state before returning. RETURN VALUEThe sigpause() function suspends execution of the thread until a signal is received, whereupon it shall return -1 and set errno to EINTR. WARNINGSThe _XPG4_EXTENDED compiler option must be set to use sigpause(). The use of the function without the option is unspecified. sigpause() should not be used in conjunction with signal(2) and sigspace(2). OBSOLESCENT FUNCTIONsigpause(long) will be obsoleted in the near future. The obsolescent sigpause() function blocks signals according to the value of mask, then atomically waits for an unmasked signal to arrive. On return, sigpause() restores the current signal mask to the value that existed before the sigpause() call. When no signals are to be blocked, a value of 0L is used for mask. sigpause() terminates when it is interrupted by a signal. When sigpause() terminates, it returns -l and sets errno to EINTR. The obsolescent sigpause() function is typically used in conjunction with the obsoleted sigblock() function. Threads ConsiderationsSince blocked signal masks are maintained at the thread level, the obsolescent sigpause() function modifies only the calling thread's blocked signal mask. sigpause() suspends only the calling thread until it receives a signal. If other threads in the process do not block the signal, the signal may be delivered to another thread in the process and the thread in sigpause() may continue waiting. For this reason, the use of sigwait(2) is recommended instead of sigpause() for multi-threaded applications. For more information regarding signals and threads, refer to signal(5). SEE ALSOkill(1), kill(2), pause(2), signal(2), wait(2), abort(3C), setjmp(3C), sighold(3C), sigignore(3C), sigrelse(3C), sigset(3C), signal(5). |
Printable version | ||
|