Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

abort - abort process

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

not C11
void abort(void); (End)
C11
_Noreturn void abort(void); (End)

Description

If the function is called with POSIX functionality, its behavior conforms with XPG4 as described below:

  • If the signal SIGABRT is not being caught and the signal handler does not return,
    abort() causes abnormal process termination to occur. The SIGABRT signal is sent
    to the calling process as if by means of the raise() function with the argument
    SIGABRT. Before the process is terminated, all open streams and message catalog
    descriptors are closed as if by a call to fclose(), and the default actions defined for
    SIGABRT are performed (see signal.h).

  • The status made available to wait() or waitpid() by abort() will be that of a
    process terminated by the SIGABRT signal. The abort() function will override blocking
    or ignoring the SIGABRT signal.

  • Process abort functions registered with atexit() are not called.

If threads are used, then the function affects the process or a thread in the following
manner:

  • The process is aborted and all its threads are aborted with it.

    BS2000

  • The following deviation in behavior must be noted when the function is called with
    BS2000 functionality:

    If the program does not provide any signal handling function or if such a function returns
    to the interrupt point, the process is aborted with _exit(-1). (End)

Notes

Catching the signal is intended to provide the application writer with a portable means to
abort processing, free from possible interference from any proprietary library functions.

If SIGABRT is neither caught nor ignored, and the current directory is writable, a core dump
may be produced.

See also

atexit(), exit(), kill(), raise(), signal(), stdlib.h, section “Signals”.