Skip to main content

Posts

Showing posts from June, 2017
8.4 Catching and Ignoring Signals—sigaction The sigaction function allows the caller to examine or specify the action associated with a specific signal. The sig parameter of sigaction specifies the signal number for the action. The act parameter is a pointer to a struct sigaction structure that specifies the action to be taken. The oact parameter is a pointer to a struct sigaction structure that receives the previous action associated with the signal. If act is NULL, the call to sigaction does not change the action associated with the signal. If oact is NULL, the call to sigaction does not return the previous action associated with the signal. SYNOPSIS #include <signal.h> int sigaction(int sig, const struct sigaction *restrict act, struct sigaction *restrict oact); POSIX:CX If successful, sigaction returns 0. If unsuccessful, sigaction returns –1 and sets errno. The following table lists the mandatory errors for sigaction. Programs sometimes use signals to hand...