1ABORT(3P) POSIX Programmer's Manual ABORT(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 abort - generate an abnormal process abort
13
15 #include <stdlib.h>
16
17 void abort(void);
18
19
21 The abort() function shall cause abnormal process termination to occur,
22 unless the signal SIGABRT is being caught and the signal handler does
23 not return.
24
25 The abnormal termination processing shall include the default actions
26 defined for SIGABRT and may include an attempt to effect fclose() on
27 all open streams.
28
29 The SIGABRT signal shall be sent to the calling process as if by means
30 of raise() with the argument SIGABRT.
31
32 The status made available to wait() or waitpid() by abort() shall be
33 that of a process terminated by the SIGABRT signal. The abort() func‐
34 tion shall override blocking or ignoring the SIGABRT signal.
35
37 The abort() function shall not return.
38
40 No errors are defined.
41
42 The following sections are informative.
43
45 None.
46
48 Catching the signal is intended to provide the application writer with
49 a portable means to abort processing, free from possible interference
50 from any implementation-defined functions.
51
53 The ISO/IEC 9899:1999 standard requires the abort() function to be
54 async-signal-safe. Since IEEE Std 1003.1-2001 defers to the ISO C stan‐
55 dard, this required a change to the DESCRIPTION from ``shall include
56 the effect of fclose()'' to ``may include an attempt to effect
57 fclose().''
58
59 The revised wording permits some backwards-compatibility and avoids a
60 potential deadlock situation.
61
62 The Open Group Base Resolution bwg2002-003 is applied, removing the
63 following XSI shaded paragraph from the DESCRIPTION:
64
65 ``On XSI-conformant systems, in addition the abnormal termination pro‐
66 cessing shall include the effect of fclose() on message catalog
67 descriptors.''
68
69 There were several reasons to remove this paragraph:
70
71 * No special processing of open message catalogs needs to be performed
72 prior to abnormal process termination.
73
74 * The main reason to specifically mention that abort() includes the
75 effect of fclose() on open streams is to flush output queued on the
76 stream. Message catalogs in this context are read-only and, there‐
77 fore, do not need to be flushed.
78
79 * The effect of fclose() on a message catalog descriptor is unspeci‐
80 fied. Message catalog descriptors are allowed, but not required to
81 be implemented using a file descriptor, but there is no mention in
82 IEEE Std 1003.1-2001 of a message catalog descriptor using a stan‐
83 dard I/O stream FILE object as would be expected by fclose().
84
86 None.
87
89 exit(), kill(), raise(), signal(), wait(), waitpid(), the Base Defini‐
90 tions volume of IEEE Std 1003.1-2001, <stdlib.h>
91
93 Portions of this text are reprinted and reproduced in electronic form
94 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
95 -- Portable Operating System Interface (POSIX), The Open Group Base
96 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
97 Electrical and Electronics Engineers, Inc and The Open Group. In the
98 event of any discrepancy between this version and the original IEEE and
99 The Open Group Standard, the original IEEE and The Open Group Standard
100 is the referee document. The original Standard can be obtained online
101 at http://www.opengroup.org/unix/online.html .
102
103
104
105IEEE/The Open Group 2003 ABORT(3P)