cause abnormal program termination

You're viewing an older version of this page (#3470). View the current version.

View versions (3)

Interface

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

Description

The abort function causes abnormal program termination to occur, unless the signal <span class="Dv">SIGABRT</span> is being caught and the signal handler does not return.

Any open streams are flushed and closed.

Example 1

#include <stdlib.h>

int main()
{
  int a = 2;
  abort();

  // this will never execute
  a = 3;

  return 0;
}

Implementation Notes

The abort function is thread-safe. It is unknown if it is async-cancel-safe.

Return Values

The abort function never returns.

See Also

exit