Structure that specifies how to handle a signal
The definition of struct sigaction is complicated; see <signal.h> for details.
The sigaction structure specifies how to handle a signal. You'll use this structure when you call sigaction() or SignalAction(). The members include the following:
These functions ignore SA_RESETHAND if you set it for SIGILL or SIGTRAP.
The sa_handler and sa_sigaction members of act are implemented as a union and share common storage. They differ only in their prototypes, with sa_handler being used for POSIX 1003.1a signals, and sa_sigaction being used for POSIX 1003.1b queued realtime signals. The values stored using either name can be one of:
The function member of sa_handler or sa_sigaction is always invoked with the following arguments:
void handler(int signo, siginfo_t *info, void *other)
If you have an old-style signal handler of the form:
void handler(int signo)
the microkernel passes the extra arguments, but the function simply ignores them. The info argument is a pointer to a siginfo_t structure that contains details about the signal.
While in the handler, signo is masked, preventing nested signals of the same type. In addition, any signals set in the sa_mask member of act are also ORed into the mask. When the handler returns through a normal return, the previous mask is restored, and any pending and now unmasked signals are acted on. You return to the point in the program where it was interrupted. If the thread was blocked in the kernel when the interruption occurred, the kernel call returns with an EINTR (see ChannelCreate() and SyncMutexLock() for exceptions to this).
See sigaction().