📄 abort.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2004 IEEE and The Open Group, All Rights Reserved --><title>abort</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="abort"></a> <a name="tag_03_07"></a><!-- abort --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright © 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_07_01"></a>NAME</h4><blockquote>abort - generate an abnormal process abort</blockquote><h4><a name="tag_03_07_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>#include <<a href="../basedefs/stdlib.h.html">stdlib.h</a>><br><br> void abort(void);<br></tt></code></p></blockquote><h4><a name="tag_03_07_03"></a>DESCRIPTION</h4><blockquote><div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> The functionality described on this reference page is aligned with the ISO C standard. Any conflict between therequirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers tothe ISO C standard. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div><p>The <i>abort</i>() function shall cause abnormal process termination to occur, unless the signal SIGABRT is being caught and thesignal handler does not return.</p><p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Theabnormal termination processing shall include the default actions defined for SIGABRT and may include an attempt to effect <a href="../functions/fclose.html"><i>fclose</i>()</a> on all open streams. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p><p>The SIGABRT signal shall be sent to the calling process as if by means of <a href="../functions/raise.html"><i>raise</i>()</a>with the argument SIGABRT.</p><p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Thestatus made available to <a href="../functions/wait.html"><i>wait</i>()</a> or <a href="../functions/waitpid.html"><i>waitpid</i>()</a> by <i>abort</i>() shall be that of a process terminated by the SIGABRT signal.<img src="../images/opt-end.gif" alt="[Option End]" border="0"> The <i>abort</i>() function shall override blocking or ignoring theSIGABRT signal.</p></blockquote><h4><a name="tag_03_07_04"></a>RETURN VALUE</h4><blockquote><p>The <i>abort</i>() function shall not return.</p></blockquote><h4><a name="tag_03_07_05"></a>ERRORS</h4><blockquote><p>No errors are defined.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_07_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_07_07"></a>APPLICATION USAGE</h4><blockquote><p>Catching the signal is intended to provide the application writer with a portable means to abort processing, free from possibleinterference from any implementation-supplied functions.</p></blockquote><h4><a name="tag_03_07_08"></a>RATIONALE</h4><blockquote><p>The ISO/IEC 9899:1999 standard requires the <i>abort</i>() function to be async-signal-safe. SinceIEEE Std 1003.1-2001 defers to the ISO C standard, this required a change to the DESCRIPTION from ``shall includethe effect of <a href="../functions/fclose.html"><i>fclose</i>()</a>'' to ``may include an attempt to effect <a href="../functions/fclose.html"><i>fclose</i>()</a>.''</p><p>The revised wording permits some backwards-compatibility and avoids a potential deadlock situation.</p><p>The Open Group Base Resolution bwg2002-003 is applied, removing the following XSI shaded paragraph from the DESCRIPTION:</p><p>``On XSI-conformant systems, in addition the abnormal termination processing shall include the effect of <a href="../functions/fclose.html"><i>fclose</i>()</a> on message catalog descriptors.''</p><p>There were several reasons to remove this paragraph:</p><ul><li><p>No special processing of open message catalogs needs to be performed prior to abnormal process termination.</p></li><li><p>The main reason to specifically mention that <i>abort</i>() includes the effect of <a href="../functions/fclose.html"><i>fclose</i>()</a> on open streams is to flush output queued on the stream. Message catalogs in thiscontext are read-only and, therefore, do not need to be flushed.</p></li><li><p>The effect of <a href="../functions/fclose.html"><i>fclose</i>()</a> on a message catalog descriptor is unspecified. Messagecatalog descriptors are allowed, but not required to be implemented using a file descriptor, but there is no mention inIEEE Std 1003.1-2001 of a message catalog descriptor using a standard I/O stream FILE object as would be expected by <ahref="../functions/fclose.html"><i>fclose</i>()</a>.</p></li></ul></blockquote><h4><a name="tag_03_07_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_07_10"></a>SEE ALSO</h4><blockquote><p><a href="exit.html"><i>exit</i>()</a>, <a href="kill.html"><i>kill</i>()</a>, <a href="raise.html"><i>raise</i>()</a>, <ahref="signal.html"><i>signal</i>()</a>, <a href="wait.html"><i>wait</i>()</a>, <a href="waitpid.html"><i>waitpid</i>()</a>, theBase Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/stdlib.h.html"><i><stdlib.h></i></a></p></blockquote><h4><a name="tag_03_07_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 1. Derived from Issue 1 of the SVID.</p></blockquote><h4><a name="tag_03_07_12"></a>Issue 6</h4><blockquote><p>Extensions beyond the ISO C standard are marked.</p><p>Changes are made to the DESCRIPTION for alignment with the ISO/IEC 9899:1999 standard.</p><p>The Open Group Base Resolution bwg2002-003 is applied.</p><p>IEEE Std 1003.1-2001/Cor 1-2002, item XSH/TC1/D6/10 is applied, changing the DESCRIPTION of abnormal terminationprocessing and adding to the RATIONALE section.</p><p>IEEE Std 1003.1-2001/Cor 2-2004, item XSH/TC2/D6/9 is applied, changing ``implementation-defined functions'' to``implementation-supplied functions'' in the APPLICATION USAGE section.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -