sigaction(2P) INTERACTIVE UNIX System (POSIX) sigaction(2P)
NAME
sigaction - examine and change signal action
SYNOPSIS
#include <signal.h>
int sigaction (sig, act, oact)
int sig;
struct sigaction *act, *oact;
DESCRIPTION
The sigaction () function allows the calling process to
examine and/or specify the action to be associated with a
specific signal. The argument sig specifies the signal;
acceptable values are defined in <signal.h>.
sig can be assigned any one of the following except SIGKILL
or SIGSTOP:
SIGHUP 01 hangup
SIGINT 02 interrupt
SIGQUIT 03 quit
SIGILL 04 illegal instruction (not reset when caught)
SIGTRAP 05 trace trap (not reset when caught)
SIGIOT 06 IOT instruction
SIGABRT 06 used by abort, replaces SIGIOT
SIGEMT 07 EMT instruction
SIGFPE 08 floating point exception
SIGKILL 09 kill (cannot be caught or ignored)
SIGBUS 10 bus error
SIGSEGV 11 segmentation violation
SIGSYS 12 bad argument to system call
SIGPIPE 13 write on a pipe with no one to read it
SIGALRM 14 alarm clock
SIGTERM 15 software termination signal
SIGUSR1 16 user-defined signal 1
SIGUSR2 17 user-defined signal 2
SIGCLD 18 death of a child
SIGPWR 19 power fail
SIGPOLL 22 selectable event pending
SIGCONT 23 continue if stopped
SIGSTOP 24 stop (cannot be caught or ignored)
SIGTSTP 25 interactive stop
SIGTTIN 26 background read attempted
SIGTTOU 27 background write attempted
If the argument act is not NULL, it points to a structure
specifying the action to be associated with the specified
signal. If the argument oact is not NULL, the action previ-
ously associated with the signal is stored in the location
pointed to by the argument oact . If the argument act is
NULL, signal handling is unchanged by this call; thus the
call can be used to inquire about the current handling of a
given signal. The sa_handler field of the sigaction
Rev. 1.1 Page 1
sigaction(2P) INTERACTIVE UNIX System (POSIX) sigaction(2P)
structure identifies a set of signals that will be added to
the process's signal mask before the signal-catching func-
tion is invoked. The SIGKILL and SIGSTOP signals may not be
added to the signal mask using this mechanism; this restric-
tion is enforced by the system without causing an error to
be indicated.
The sa_flags field can be used to modify the behavior of the
specified signal. The bit SA_NOCLDSTOP, defined in
<signal.h>, can be set to prevent the generation of SIGCHLD
when children stop.
If the sigaction() function fails, no new signal handler is
installed.
DIAGNOSTICS
Upon successful completion, a value of zero is returned.
Otherwise, a value of -1 is returned, and errno is set to
indicate the error.
Rev. 1.1 Page 2