@node sigaction, signal @subheading Syntax @example #include int sigaction (int sig, const struct sigaction *act, struct sigaction *oact); @end example @subheading Description This function allows to examine and/or change the action associated with a signal @var{sig}. The @code{struct sigaction} structure, defined by the header file @file{signal.h}, is declared as follows: @example struct sigaction @{ int sa_flags; /* flags for the action; currently ignored */ void (*sa_handler)(int); /* the handler for the signal */ sigset_t sa_mask; /* additional signals to be blocked */ @}; @end example The @code{sa_handler} member is a signal handler, see @ref{signal}. The @code{sa_mask} member defines the signals, in addition to @var{sig}, which are to be blocked during the execution of @code{sa_handler}. The @code{sigaction} function sets the structure pointed to by @code{oact} to the current action for the signal @var{sig}, and then sets the new action for @var{sig} as specified by @var{act}. If the @var{act} argument is @code{NULL}, @code{sigaction} returns the current signal action in @var{oact}, but doesn't change it. If the @var{oact} argument is a @code{NULL} pointer, it is ignored. Thus, passing @code{NULL} pointers for both @code{act} and @code{oact} is a way to see if @var{sig} is a valid signal number on this system (if not, @code{sigaction} will return -1 and set @code{errno}). @subheading Return Value 0 on success, -1 for illegal value of @var{sig}. @subheading Portability @portability !ansi, posix