...
| Wiki Markup |
|---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="cc5fe66a699d146d-6c42a61f-4cab4696-94bd99e0-e93e119c06d2e2e330175f67"><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="26901d7406aba89e-0bf56931-40d546af-bfd2a489-85554b8417a07252b3ab3a97"><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 | | | | |
...