_Exit(3): document implementation

Remove a useless note about unlinking temporary files, they are unlinked
in tmpfile(3) [1].  Add a note about __cxa_atexit().

Explain exactly what are the FreeBSD implementation differences between
exit() and _Exit().

Noted by:	markj [1]
Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D31425
This commit is contained in:
Konstantin Belousov 2021-08-05 19:04:44 +03:00
parent 2a51e8823a
commit ee62fb2e1e

View File

@ -32,7 +32,7 @@
.\" @(#)exit.3 8.1 (Berkeley) 6/4/93 .\" @(#)exit.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd March 22, 2020 .Dd August 5, 2021
.Dt EXIT 3 .Dt EXIT 3
.Os .Os
.Sh NAME .Sh NAME
@ -58,17 +58,17 @@ Before termination,
performs the following functions in the order listed: performs the following functions in the order listed:
.Bl -enum -offset indent .Bl -enum -offset indent
.It .It
Call the functions registered with the Call all functions registered with the
.Xr __cxa_atexit 3
function
(which are typically destructors from the loaded dynamic objects),
and the functions registered with the
.Xr atexit 3 .Xr atexit 3
function, in the reverse order of their registration. function, in the reverse order of their registration.
.It .It
Flush all open output streams. Flush all open output streams.
.It .It
Close all open streams. Close all open streams.
.It
Unlink all files created with the
.Xr tmpfile 3
function.
.El .El
.Pp .Pp
The The
@ -76,6 +76,14 @@ The
function terminates without calling the functions registered with the function terminates without calling the functions registered with the
.Xr atexit 3 .Xr atexit 3
function, and may or may not perform the other actions listed. function, and may or may not perform the other actions listed.
The
.Fx
implementation of the
.Fn _Exit
function does not call destructors registered with
.Xr __cxa_atexit 3,
does not flush buffers, and does not close streams.
.Pp
Both functions make the low-order eight bits of the Both functions make the low-order eight bits of the
.Fa status .Fa status
argument available to a parent process which has called a argument available to a parent process which has called a