![]() |
![]() |
![]() |
Raise the SIGABRT signal to terminate program execution
#include <stdlib.h> void abort( void );
libc
The abort() function causes abnormal process termination to occur, unless the signal SIGABRT is caught and the signal handler doesn't return. The status unsuccessful termination is returned to the invoking process by means means of the function call raise(SIGABRT).
Under QNX 6, the unsuccessful termination status value is 6.
The abort() function doesn't return to its caller.
#include <stdlib.h> int main( void ) { int major_error = 1; if( major_error ) abort(); /* You'll never get here. */ return EXIT_SUCCESS; }
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Not applicable |
Thread | Yes |
A strictly-conforming POSIX application can't assume that the abort() function is safe to use in a signal handler on other platforms.
atexit(), close(), execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe(), _exit(), exit(), getenv(), main(), putenv(), sigaction(), signal(), spawn*() functions, system(), wait(), waitpid()
![]() |
![]() |
![]() |