COHERENT manpages

This page displays the COHERENT manpage for sigaction() [Perform detailed signal management].

List of available manpages
Index


sigaction() -- System Call (libc)

Perform detailed signal management
#include <signal.h>
int sigaction (signal, action, old_action)
int signal; const struct sigaction *action; struct sigaction *old_action;

sigaction() lets  the calling process specify the action  it will take when
it receives signal.

signal can  be any of the  signals named in the  Lexicon entry for signal()
except SIGKILL and SIGSTOP.

action points to a structure that  specifies the action to take when signal
is received.   If action  is set  to NULL, the  current disposition  of the
signal is unaffected.

old_action  points to  a  structure that  describes  the action  previously
associated  with  signal, and  that  is  to be  restored  upon return  from
sigaction().

The structure sigaction has the following members:

    void    (*sa_handler)();
    sigset_t    sa_mask;
    int sa_flags;

sa_handler gives the  disposition of the signal.  You can  set it to any of
the actions described in the article for signal().

sa_mask identifies  the signals to  be blocked while the  signal handler is
active.  Upon entry to the signal  handler, that set of signals is added to
the set of signals already  being blocked when signal was received.  signal
itself is also blocked.  Note that you cannot block SIGSTOP and SIGKILL.

sa_flags specifies a set of flags used to modify the behavior of signal. As
of this writing, sigaction() recognizes only the flag SA_NOCLDSTOP: If this
is set and signal equals SIGCHLD, signal is not sent to the calling process
when its child processes stop or continue.

sigaction() returns zero if all is well.  It fails and returns -1 if either
of the following is true:

-> signal  does not  identify a  valid signal.   sigaction() sets  errno to
   EINVAL.

-> action  or old_action  points  outside the  process's allocated  address
   space.  sigaction() sets errno to EFAULT.

See Also

libc,
sigaddset(),
sigdelset(),
sigemptyset(),
sigfillset(),
sigismember(),
signal(),
signal.h,
sigpending(),
sigprocmask(),
sigset(),
siglongjmp(),
sigsetjmp(),
sigsuspend()
POSIX Standard, §3.3.4