C signal handling: Difference between revisions

Content deleted Content added
No edit summary
m fixed dashes using a script, script-assisted date audit and style fixes per MOS:NUM
Line 1:
{{Short description|Handling of signals in the C programming language}}
{{Use dmy dates|date=MayJuly 20202022}}
{{C_Standard Library}}
 
Line 10:
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=https://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>
 
*<code>SIGABRT</code> - "abort", abnormal termination.
*<code>SIGFPE</code> - [[Floating point exception|'''f'''loating '''p'''oint '''e'''xception]].
*<code>SIGILL</code> - "illegal", invalid instruction.
*<code>SIGINT</code> - "interrupt", interactive attention request sent to the program.
*<code>SIGSEGV</code> - "[[segmentation violation|'''seg'''mentation '''v'''iolation]]", invalid memory access.
*<code>SIGTERM</code> - "terminate", termination request sent to the program.
 
Additional signals may be specified in the <code>signal.h</code> header by the implementation. For example, Unix and [[Unix-like]] operating systems (such as [[Linux]]) define more than 15 additional signals; see [[Unix signal]].<ref name="sus">{{cite web | url=https://pubs.opengroup.org/onlinepubs/007904975/ | title=The Open Group Base Specifications Issue 6 - signal.h - signals | accessdate=10 January 2012}}</ref>
 
=== Debugging ===