Added more detail on exit handlers.

Minor wording fixes.
This commit is contained in:
Michael Kerrisk 2007-05-30 16:08:52 +00:00
parent b0742c81c6
commit 65b70abf11
1 changed files with 18 additions and 3 deletions

View File

@ -20,7 +20,7 @@
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH EXIT 3 2001-11-17 "" "Linux Programmer's Manual"
.TH EXIT 3 2007-06-12 "Linux" "Linux Programmer's Manual"
.SH NAME
exit \- cause normal process termination
.SH SYNOPSIS
@ -50,8 +50,23 @@ to register an additional
function to be executed during exit processing;
the new registration is added to the front of the list of functions
that remain to be called.)
If one of these functions does not return
(e.g., it calls
.BR _exit (2),
or kills itself with a signal),
then none of the remaining functions is called,
and further exit processing (in particular, flushing of
.BR stdio (3)
streams) is abandoned.
If a function has been registered multiple times using
.BR atexit (3)
or
.BR on_exit (3),
then it is called as many times as it was registered.
.LP
All open streams are flushed and closed.
All open
.BR stdio (3)
streams are flushed and closed.
Files created by
.BR tmpfile (3)
are removed.
@ -81,7 +96,7 @@ or
.BR longjmp (3).
.LP
The use of EXIT_SUCCESS and EXIT_FAILURE is slightly more portable
(to non-Unix environments) than that of 0 and some non-zero value
(to non-Unix environments) than the use of 0 and some non-zero value
like 1 or \-1.
In particular, VMS uses a different convention.
.LP