aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bunichev <tembun@bk.ru>2026-03-31 17:09:00 +0000
committerAlexander Ziaee <ziaee@FreeBSD.org>2026-03-31 17:13:02 +0000
commitc082e5656417945bfa567114c60969844f3d7bdf (patch)
tree5c939680c36d416a78623be31270ef43e3abb9c2
parent407b1e4980189252fade78438aa08191a9883cdc (diff)
_exit.2: Cross-reference atexit(3)
atexit(3) is one of the cases when _exit(2) must be used instead of exit(3). MFC after: 3 days Reviewed by: mhorne, ziaee Differential Revision: https://reviews.freebsd.org/D54467
-rw-r--r--lib/libc/stdlib/atexit.33
-rw-r--r--lib/libsys/_exit.29
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/stdlib/atexit.3 b/lib/libc/stdlib/atexit.3
index 4ff384813550..4082c887497c 100644
--- a/lib/libc/stdlib/atexit.3
+++ b/lib/libc/stdlib/atexit.3
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 6, 2002
+.Dd March 31, 2026
.Dt ATEXIT 3
.Os
.Sh NAME
@@ -90,6 +90,7 @@ function was called by a program that did not supply a
implementation.
.El
.Sh SEE ALSO
+.Xr _exit 2 ,
.Xr at_quick_exit 3 ,
.Xr exit 3
.Sh STANDARDS
diff --git a/lib/libsys/_exit.2 b/lib/libsys/_exit.2
index 6f038f79f6ea..6e46e65ac86e 100644
--- a/lib/libsys/_exit.2
+++ b/lib/libsys/_exit.2
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 8, 2016
+.Dd March 31, 2026
.Dt EXIT 2
.Os
.Sh NAME
@@ -95,9 +95,9 @@ and all current access to the controlling terminal is revoked.
.Pp
Most C programs call the library routine
.Xr exit 3 ,
-which flushes buffers, closes streams, unlinks temporary files, etc.,
-before
-calling
+which flushes buffers, closes streams, unlinks temporary files, invokes
+.Xr atexit 3
+handlers, etc., before calling
.Fn _exit .
.Sh RETURN VALUES
The
@@ -108,6 +108,7 @@ can never return.
.Xr fork 2 ,
.Xr sigaction 2 ,
.Xr wait 2 ,
+.Xr atexit 3 ,
.Xr exit 3 ,
.Xr init 8
.Sh STANDARDS