ssiiggaaccttiioonn() -- System Call (libc)

Perform detailed signal management
#iinncclluuddee <ssiiggnnaall.hh>
iinntt ssiiggaaccttiioonn (_s_i_g_n_a_l, _a_c_t_i_o_n, _o_l_d__a_c_t_i_o_n)
iinntt _s_i_g_n_a_l; ccoonnsstt ssttrruucctt ssiiggaaccttiioonn *_a_c_t_i_o_n; ssttrruucctt ssiiggaaccttiioonn *_o_l_d__a_c_t_i_o_n;

ssiiggaaccttiioonn() lets  the calling process specify the action  it will take when
it receives _s_i_g_n_a_l.

_s_i_g_n_a_l can  be any of the  signals named in the  Lexicon entry for ssiiggnnaall()
except SSIIGGKKIILLLL and SSIIGGSSTTOOPP. _a_c_t_i_o_n points to a structure that specifies the
action to  take when _s_i_g_n_a_l is received.  _o_l_d__a_c_t_i_o_n  points to a structure
that describes the action previously associated with _s_i_g_n_a_l, and that is to
be restored upon return from ssiiggaaccttiioonn().

The structure ssiiggaaccttiioonn has the following members:

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

ssaa_hhaannddlleerr gives the  disposition of the signal.  You can  set it to any of
the actions described in the article for ssiiggnnaall().

ssaa_mmaasskk 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 _s_i_g_n_a_l was received.  _s_i_g_n_a_l
itself is also blocked.  Note that you cannot block SSIIGGSSTTOOPP and SSIIGGKKIILLLL.

ssaa_ffllaaggss specifies a set of flags used to modify the behavior of _s_i_g_n_a_l. As
of this writing, ssiiggaaccttiioonn() recognizes only the flag SSAA_NNOOCCLLDDSSTTOOPP: If this
is set and _s_i_g_n_a_l equals SSIIGGCCHHLLDD, _s_i_g_n_a_l is not sent to the calling process
when its child processes stop or continue.

ssiiggaaccttiioonn() returns zero if all is well.  It fails and returns -1 if either
of the following is true:

-> _s_i_g_n_a_l  does not  identify a  valid signal.   ssiiggaaccttiioonn() sets  eerrrrnnoo to
   EEIINNVVAALL.

-> _a_c_t_i_o_n  or _o_l_d__a_c_t_i_o_n  points  outside the  process's allocated  address
   space.  ssiiggaaccttiioonn() sets eerrrrnnoo to EEFFAAUULLTT.

_S_e_e _A_l_s_o
lliibbcc,   ssiiggnnaall(),    ssiiggnnaall.hh,   ssiiggppeennddiinngg(),   ssiiggpprrooccmmaasskk(),   ssiiggsseett(),
ssiigglloonnggjjmmpp(), ssiiggsseettjjmmpp(), ssiiggssuussppeenndd()
POSIX Standard, section 3.3.4
