]>
Commit | Line | Data |
---|---|---|
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 | 36 | abort \- 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 |
44 | The |
45 | .BR abort () | |
db49e937 | 46 | first unblocks the |
8bd58774 | 47 | .B SIGABRT |
34fcd227 MK |
48 | signal, and then raises that signal for the calling process |
49 | (as though | |
50 | .BR raise (3) | |
51 | was called). | |
db49e937 MK |
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 | |
60a90ecd | 58 | If the |
8bd58774 | 59 | .B SIGABRT |
db49e937 | 60 | signal is ignored, or caught by a handler that returns, the |
60a90ecd | 61 | .BR abort () |
db49e937 MK |
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. | |
47297adb | 66 | .SH RETURN VALUE |
60a90ecd MK |
67 | The |
68 | .BR abort () | |
69 | function never returns. | |
bcefc0e3 | 70 | .SH ATTRIBUTES |
74a70e34 MK |
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{ | |
bcefc0e3 | 79 | .BR abort () |
74a70e34 MK |
80 | T} Thread safety MT-Safe |
81 | .TE | |
46dc471b MK |
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". | |
47297adb | 97 | .SH CONFORMING TO |
34fcd227 | 98 | SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99. |
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) |