[Previous]
[Contents]
[Next]

abort()

raise the SIGABRT signal to terminate program execution

Synopsis:

#include <stdlib.h>
void abort( void );

Description:

The abort() function raises the signal SIGABRT. The default action for SIGABRT is to terminate program execution, returning control to the process that started the calling program (usually the operating system). The status unsuccessful termination is returned to the invoking process by means of the function call raise(SIGABRT).

Under QNX, the status value is 12. This is obtained by passing the return value to the WEXITSTATUS() macro - see waitpid().

Returns:

The abort() function doesn't return to its caller.

Examples:

#include <stdlib.h>

void main()
  {
    int major_error = 1;

    if( major_error )
      abort();
  }

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

atexit(), _bgetcmd(), close(), exec... functions, exit(), _exit(), getcmd(), getenv(), main(), onexit(), putenv(), sigaction(), signal(), spawn... functions, system(), wait(), waitpid()


[Previous]
[Contents]
[Next]