Date: Sun, 8 Aug 2021 19:51:30 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ee62fb2e1e14 - main - _Exit(3): document implementation Message-ID: <202108081951.178JpUko030449@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ee62fb2e1e14eab35d4e4e92535bcac9fc91eeb8 commit ee62fb2e1e14eab35d4e4e92535bcac9fc91eeb8 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-08-05 16:04:44 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-08-08 19:39:46 +0000 _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 --- lib/libc/stdlib/exit.3 | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/libc/stdlib/exit.3 b/lib/libc/stdlib/exit.3 index 9c2b79b72956..ff7a67ffcb85 100644 --- a/lib/libc/stdlib/exit.3 +++ b/lib/libc/stdlib/exit.3 @@ -32,7 +32,7 @@ .\" @(#)exit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 22, 2020 +.Dd August 5, 2021 .Dt EXIT 3 .Os .Sh NAME @@ -58,17 +58,17 @@ Before termination, performs the following functions in the order listed: .Bl -enum -offset indent .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 function, in the reverse order of their registration. .It Flush all open output streams. .It Close all open streams. -.It -Unlink all files created with the -.Xr tmpfile 3 -function. .El .Pp The @@ -76,6 +76,14 @@ The function terminates without calling the functions registered with the .Xr atexit 3 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 .Fa status argument available to a parent process which has called a
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108081951.178JpUko030449>