Content deleted Content added
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
date format audit, minor formatting |
||
Line 1:
{{C_Standard Library}}
Line 4 ⟶ 5:
==Standard signals==
{{see also|Unix signal}}
The C standard defines only 6 signals. They are all defined in <code>signal.h</code> header (<code>csignal</code> header in [[C++]]):<ref name=c99>{{cite book | url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf | title=ISO/IEC 9899:1999 specification | at=p. 258, § 7.14 ''Signal handling''}}</ref>
Line 23 ⟶ 24:
A signal handler is a [[Function (computer science)|function]] which is called by the target environment when the corresponding signal occurs. The target environment suspends execution of the program until the signal handler returns or calls <code>longjmp()</code>.
Signal handlers can be set be with <code>signal()</code> or <code>sigaction()</code>. The behavior of <code>signal()</code> has been changed multiple times across history and is now considered deprecated.<ref>http://man7.org/linux/man-pages/man2/signal.2.html Signal(2) manpage</ref>
If the signal reports an error within the program (and the signal is not asynchronous), the signal handler can terminate by calling <code>abort()</code>, <code>exit()</code>, or <code>longjmp()</code>.
Line 73 ⟶ 74:
==References==
{{Reflist}}
▲{{Use dmy dates|date=January 2012}}
[[Category:C standard library]]
|