abort
Go Up to stdlib.h Index
Header File
stdlib.h
Category
Process Control Routines
Prototype
void abort(void);
Description
Abnormally terminates a program.
abort causes an abnormal program termination by calling raise(SIGABRT). If there is no signal handler for SIGABRT, then abort writes a termination message (Abnormal program termination) on stderr, then aborts the program by a call to _exit with exit code 3.
Return Value
abort returns the exit code 3 to the parent process or to the operating system command processor.
Example
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Calling abort()\n");
abort();
return 0; /* This is never reached */
}
Portability
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |
+ |
+ |
+ |