1ABORT(3)                   Linux Programmer's Manual                  ABORT(3)
2
3
4

NAME

6       abort - cause abnormal process termination
7

SYNOPSIS

9       #include <stdlib.h>
10
11       noreturn void abort(void);
12

DESCRIPTION

14       The abort() function first unblocks the SIGABRT signal, and then raises
15       that signal for the calling process (as though  raise(3)  was  called).
16       This  results  in  the  abnormal  termination of the process unless the
17       SIGABRT signal is caught and the signal handler does  not  return  (see
18       longjmp(3)).
19
20       If  the SIGABRT signal is ignored, or caught by a handler that returns,
21       the abort() function will still terminate the process.  It does this by
22       restoring the default disposition for SIGABRT and then raising the sig‐
23       nal for a second time.
24

RETURN VALUE

26       The abort() function never returns.
27

ATTRIBUTES

29       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
30       tributes(7).
31
32       ┌────────────────────────────────────────────┬───────────────┬─────────┐
33Interface                                   Attribute     Value   
34       ├────────────────────────────────────────────┼───────────────┼─────────┤
35abort()                                     │ Thread safety │ MT-Safe │
36       └────────────────────────────────────────────┴───────────────┴─────────┘
37

CONFORMING TO

39       SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
40

NOTES

42       Up  until  glibc  2.26, if the abort() function caused process termina‐
43       tion, all open streams were closed and  flushed  (as  with  fclose(3)).
44       However,  in some cases this could result in deadlocks and data corrup‐
45       tion.  Therefore, starting with  glibc  2.27,  abort()  terminates  the
46       process  without flushing streams.  POSIX.1 permits either possible be‐
47       havior, saying that abort() "may include an attempt to effect  fclose()
48       on all open streams".
49

SEE ALSO

51       gdb(1), sigaction(2), assert(3), exit(3), longjmp(3), raise(3)
52

COLOPHON

54       This  page  is  part of release 5.12 of the Linux man-pages project.  A
55       description of the project, information about reporting bugs,  and  the
56       latest     version     of     this    page,    can    be    found    at
57       https://www.kernel.org/doc/man-pages/.
58
59
60
61GNU                               2021-03-22                          ABORT(3)
Impressum