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.

Returns:

The abort() function does not return to its caller.

See also:

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

Examples:

#include <stdlib.h>

void main()
  {
    int major_error = 1;

    if( major_error )
      abort();
  }

Classification:

ANSI

Systems:

All (except DOS/PM)