<s>
In	O
computing	O
,	O
sigaction	B-Language
is	O
a	O
function	O
API	O
defined	O
by	O
POSIX	O
to	O
give	O
the	O
programmer	O
access	O
to	O
what	O
should	O
be	O
a	O
program	O
's	O
behavior	O
when	O
receiving	O
specific	O
OS	O
signals	B-Operating_System
.	O
</s>
<s>
In	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
,	O
one	O
means	O
of	O
inter-process	B-Operating_System
communication	I-Operating_System
is	O
through	O
signals	B-Operating_System
.	O
</s>
<s>
When	O
an	O
executing	O
unit	O
(	O
process	B-Operating_System
or	O
thread	B-Operating_System
)	O
receives	O
a	O
signal	O
from	O
the	O
OS	O
,	O
it	O
should	O
react	O
in	O
some	O
way	O
defined	O
by	O
the	O
datasheet	O
and	O
the	O
conventional	O
meaning	O
of	O
this	O
signal	O
(	O
i.e.	O
</s>
<s>
The	O
sigaction( )	O
system	O
call	O
is	O
used	O
to	O
declare	O
the	O
behavior	O
of	O
the	O
program	O
should	O
it	O
receive	O
one	O
particular	O
non-system-reserved	O
signal	O
.	O
</s>
<s>
This	O
is	O
done	O
by	O
giving	O
along	O
with	O
the	O
system	O
call	O
a	O
structure	O
containing	O
,	O
among	O
others	O
,	O
a	O
function	O
pointer	O
to	O
the	O
signal	B-Operating_System
handling	I-Operating_System
routine	O
.	O
</s>
<s>
Some	O
predefined	O
signals	B-Operating_System
(	O
such	O
as	O
SIGKILL	O
)	O
have	O
locked	O
behavior	O
that	O
is	O
handled	O
by	O
the	O
system	O
and	O
cannot	O
be	O
overridden	O
by	O
such	O
system	O
calls	O
.	O
</s>
<s>
The	O
POSIX	O
standard	O
requires	O
that	O
the	O
sigaction	B-Language
structure	O
be	O
defined	O
as	O
below	O
in	O
the	O
<signal.h>	O
header	O
file	O
and	O
it	O
should	O
contain	O
at	O
least	O
the	O
following	O
fields	O
:	O
</s>
<s>
The	O
sa_handler	O
member	O
specifies	O
the	O
address	O
of	O
a	O
function	O
to	O
be	O
called	O
when	O
the	O
process	B-Operating_System
receives	O
the	O
signal	O
.	O
</s>
<s>
The	O
sa_mask	O
member	O
specifies	O
additional	O
signals	B-Operating_System
to	O
be	O
blocked	O
during	O
the	O
execution	O
of	O
signal	B-Operating_System
handler	I-Operating_System
.	O
</s>
<s>
sa_sigaction	O
is	O
an	O
alternate	O
signal	B-Operating_System
handler	I-Operating_System
with	O
different	O
set	O
of	O
parameters	O
.	O
</s>
<s>
Only	O
one	O
signal	B-Operating_System
handler	I-Operating_System
must	O
be	O
specified	O
,	O
either	O
sa_handler	O
or	O
sa_sigaction	O
.	O
</s>
<s>
The	O
sigaction( )	O
function	O
provides	O
an	O
interface	O
for	O
reliable	O
signals	B-Operating_System
in	O
replacement	O
of	O
the	O
unreliable	O
signal( )	O
function	O
.	O
</s>
<s>
Signal	B-Operating_System
handlers	I-Operating_System
installed	O
by	O
the	O
signal( )	O
interface	O
will	O
be	O
uninstalled	O
immediately	O
prior	O
to	O
execution	O
of	O
the	O
handler	O
.	O
</s>
<s>
Handlers	O
installed	O
by	O
the	O
sigaction( )	O
interface	O
can	O
be	O
installed	O
permanently	O
and	O
a	O
custom	O
set	O
of	O
signals	B-Operating_System
can	O
be	O
blocked	O
during	O
the	O
execution	O
of	O
the	O
handler	O
.	O
</s>
<s>
These	O
signals	B-Operating_System
will	O
be	O
unblocked	O
immediately	O
following	O
the	O
normal	O
termination	O
of	O
the	O
handler	O
(	O
but	O
not	O
in	O
the	O
event	O
of	O
an	O
abnormal	O
termination	O
such	O
as	O
a	O
C++	O
exception	O
throw	O
.	O
)	O
</s>
<s>
To	O
catch	O
signals	B-Operating_System
translated	O
into	O
C++	O
exceptions	O
,	O
special	O
compiler	O
switches	O
may	O
be	O
necessary	O
on	O
some	O
platforms	O
such	O
as	O
-fnon-call-exceptions	O
for	O
GCC	B-Application
and	O
the	O
Intel	O
C	O
Compiler	O
.	O
</s>
