
...
Wiki Markup |
---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="743ae1746a867256-333ead87-498b476f-b75797d3-57aa549488b1f8e85a3514eb"><ac:parameter ac:name="">1</ac:parameter></ac:structured-macro>\[1\] Note that POSIX ^®^ strengthens the specification for {{_Exit()}} by prohibiting the function from flushing stream buffers. See the {{[documentation|http://www.opengroup.org/onlinepubs/9699919799/functions/_Exit.html]}} of the function in \[\[OpenIEEE Group 08\]Std 1003.1-2008|AA. References#OpenReferences#IEEE Group 08Std 1003.1-2008]\]. |
Code Block | ||
---|---|---|
| ||
#include <stdlib.h> /* ... */ if (/* something really bad happened */) { _Exit(EXIT_FAILURE); } |
...
As with _Exit()
, whether open streams with unwritten buffered data are flushed #2, open streams are closed #2, or temporary files are removed is implementation-defined. Functions registered by atexit()
are not executed (see ERR06-C. Understand the termination behavior of assert() and abort()).
Wiki Markup |
---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="ad07e26cfd7ebd30-bacda364-497f4111-b9c69800-6ef30ba9c5785ee917dffc84"><ac:parameter ac:name="">2</ac:parameter></ac:structured-macro>\[2\] Unlike in the case of {{\_Exit()}}, POSIX ^®^ explicitly permits but does not require implementations to flush stream buffers. See the {{[documentation|http://www.opengroup.org/onlinepubs/9699919799/functions/abort.html]}} of the function in \[\[OpenIEEE Group 08\]Std 1003.1-2008|AA. References#OpenReferences#IEEE Group 08Std 1003.1-2008]\]. |
Summary
The following table summarizes the exit behavior of the program termination functions.
Function | Closes | Flushes | Removes | Calls | Program |
---|---|---|---|---|---|
| | | | ||
| | | | ||
| | | | | |
return from | | | | |
...