| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- install a signal mask and suspend caller until signal
#include <signal.h>intsigsuspend(const sigset_t *set);
Thesigsuspend() function replaces the caller's signal mask with the set ofsignals pointed to by theset argument and suspends the calleruntil delivery of a signal whose action is either to execute a signalcatching function or to terminate the process. If theset argument pointsto an invalid address, the behavior is undefined anderrno may beset toEFAULT.
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 maskis restored to the set that existed before the call tosigsuspend().
It is not possible to block signals that cannot be ignored (seesignal.h(3HEAD)). This restriction is silently imposed by the system.
Sincesigsuspend() suspends the caller's execution indefinitely, there is no successful completionreturn value. On failure, it returns-1 and setserrno to indicatethe error.
Thesigsuspend() function will fail if:
A signal was caught by the caller and control was returned from the signal catching function.
Thesigsuspend() function may fail if:
Theset argument points to an illegal address.
Seeattributes(5) for descriptions of the following attributes:
|
sigaction(2),sigprocmask(2),sigwait(2),signal(3C),signal.h(3HEAD),sigsetops(3C),attributes(5)
If the caller specifies more than one unblocked signal in the masktosigsuspend(), more than one signal might be processed before the calltosigsuspend() returns.
While the caller is executing the signal handler that interrupted its calltosigsuspend(), its signal mask is the one passed tosigsuspend(), modifiedas usual by the signal mask specification in the signal'ssigaction(2) parameters. The caller's signal mask is not restored to its previous valueuntil the caller returns from all the signal handlers that interruptedsigsuspend().
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |