]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/abort.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / abort.3
1 .\" Copyright 2007 (C) Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" some parts Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
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.
13 .\"
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.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
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
32 .\" 2007-12-15, mtk, Mostly rewritten
33 .\"
34 .TH ABORT 3 2017-11-26 "GNU" "Linux Programmer's Manual"
35 .SH NAME
36 abort \- cause abnormal process termination
37 .SH SYNOPSIS
38 .nf
39 .B #include <stdlib.h>
40 .PP
41 .B void abort(void);
42 .fi
43 .SH DESCRIPTION
44 The
45 .BR abort ()
46 first unblocks the
47 .B SIGABRT
48 signal, and then raises that signal for the calling process
49 (as though
50 .BR raise (3)
51 was called).
52 This results in the abnormal termination of the process unless the
53 .B SIGABRT
54 signal is caught and the signal handler does not return
55 (see
56 .BR longjmp (3)).
57 .PP
58 If the
59 .B SIGABRT
60 signal is ignored, or caught by a handler that returns, the
61 .BR abort ()
62 function will still terminate the process.
63 It does this by restoring the default disposition for
64 .B SIGABRT
65 and then raising the signal for a second time.
66 .SH RETURN VALUE
67 The
68 .BR abort ()
69 function never returns.
70 .SH ATTRIBUTES
71 For an explanation of the terms used in this section, see
72 .BR attributes (7).
73 .TS
74 allbox;
75 lb lb lb
76 l l l.
77 Interface Attribute Value
78 T{
79 .BR abort ()
80 T} Thread safety MT-Safe
81 .TE
82 .SH NOTES
83 Up until glibc 2.26,
84 if the
85 .BR abort ()
86 function caused process termination,
87 all open streams were closed and flushed (as with
88 .BR fclose (3)).
89 However, in some cases this could result in deadlocks and data corruption.
90 Therefore, starting with glibc 2.27,
91 .\" glibc commit 91e7cf982d0104f0e71770f5ae8e3faf352dea9f
92 .BR abort ()
93 terminates the process without flushing streams.
94 POSIX.1 permits either possible behavior, saying that
95 .BR abort ()
96 "may include an attempt to effect fclose() on all open streams".
97 .SH CONFORMING TO
98 SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
99 .SH SEE ALSO
100 .BR gdb (1),
101 .BR sigaction (2),
102 .BR assert (3),
103 .BR exit (3),
104 .BR longjmp (3),
105 .BR raise (3)