6.13.3 SIGABRT Macro
Name for the abnormal termination signal.
Include
<signal.h>
Remarks
The SIGABRT
macro expands to a positive integer constant expression with
type int
that represents an abnormal termination signal and is used in
conjunction with the raise()
or signal()
functions. The
default behavior of the raise()
function (action identified by
SIG_DFL
) is to output to the standard error stream: abort -
terminating
.
See the example accompanying signal()
to see general usage of signal names
and signal handling.
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <signal.h>
#include <stdio.h>
int main(void)
{
raise(SIGABRT);
printf("Program never reaches here.");
}
Example Output
ABRT
where ABRT
stands for “abort.”