abort
cause abnormal program termination
You're viewing an older version of this page (#4036). View the current version.
Interface
#include <stdlib.h>
void abort ( void )
Description
The abort function causes abnormal program termination to occur, unless the signal SIGABRT is being caught and the signal handler does not return.
Any open streams are flushed and closed.
Example 1
Workings
\code #include <stdlib.h> int main() { int a = 2; abort();
// this will never execute a = 3;
return 0; } \endcode
Implementation Notes
The abort function is thread-safe. It is unknown if it is async-cancel-safe.
Return Values
The abort function never returns.