]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/abort.3
stdarg.3: SEE ALSO: add vprintf(3), vscanf(3), vsyslog(3)
[thirdparty/man-pages.git] / man3 / abort.3
CommitLineData
db49e937
MK
1.\" Copyright 2007 (C) Michael Kerrisk <mtk.manpages@gmail.com>
2.\" some parts Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
fea681da 3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
c13182ef 13.\"
fea681da
MK
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
fea681da
MK
25.\"
26.\" References consulted:
27.\" Linux libc source code
28.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
29.\" 386BSD man pages
30.\" Modified Sat Jul 24 21:46:21 1993 by Rik Faith (faith@cs.unc.edu)
31.\" Modified Fri Aug 4 10:51:53 2000 - patch from Joseph S. Myers
db49e937 32.\" 2007-12-15, mtk, Mostly rewritten
fea681da 33.\"
1c6f59c2 34.TH ABORT 3 2017-11-26 "GNU" "Linux Programmer's Manual"
fea681da 35.SH NAME
db49e937 36abort \- cause abnormal process termination
fea681da
MK
37.SH SYNOPSIS
38.nf
39.B #include <stdlib.h>
68e4db0a 40.PP
fea681da
MK
41.B void abort(void);
42.fi
43.SH DESCRIPTION
60a90ecd
MK
44The
45.BR abort ()
576b9ea7 46function first unblocks the
8bd58774 47.B SIGABRT
34fcd227
MK
48signal, and then raises that signal for the calling process
49(as though
50.BR raise (3)
51was called).
db49e937
MK
52This results in the abnormal termination of the process unless the
53.B SIGABRT
54signal is caught and the signal handler does not return
55(see
56.BR longjmp (3)).
57.PP
60a90ecd 58If the
8bd58774 59.B SIGABRT
db49e937 60signal is ignored, or caught by a handler that returns, the
60a90ecd 61.BR abort ()
db49e937
MK
62function will still terminate the process.
63It does this by restoring the default disposition for
64.B SIGABRT
65and then raising the signal for a second time.
47297adb 66.SH RETURN VALUE
60a90ecd
MK
67The
68.BR abort ()
69function never returns.
bcefc0e3 70.SH ATTRIBUTES
74a70e34
MK
71For an explanation of the terms used in this section, see
72.BR attributes (7).
73.TS
74allbox;
75lb lb lb
76l l l.
77Interface Attribute Value
78T{
bcefc0e3 79.BR abort ()
74a70e34
MK
80T} Thread safety MT-Safe
81.TE
81b8997f
MK
82.SH CONFORMING TO
83SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
46dc471b
MK
84.SH NOTES
85Up until glibc 2.26,
86if the
87.BR abort ()
88function caused process termination,
89all open streams were closed and flushed (as with
90.BR fclose (3)).
91However, in some cases this could result in deadlocks and data corruption.
92Therefore, starting with glibc 2.27,
93.\" glibc commit 91e7cf982d0104f0e71770f5ae8e3faf352dea9f
94.BR abort ()
95terminates the process without flushing streams.
96POSIX.1 permits either possible behavior, saying that
97.BR abort ()
98"may include an attempt to effect fclose() on all open streams".
47297adb 99.SH SEE ALSO
db49e937 100.BR gdb (1),
fea681da 101.BR sigaction (2),
98f24fc6 102.BR assert (3),
fea681da 103.BR exit (3),
db49e937 104.BR longjmp (3),
fea681da 105.BR raise (3)