summaryrefslogtreecommitdiffstats
path: root/man3/atexit.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/atexit.3')
-rw-r--r--man3/atexit.354
1 files changed, 27 insertions, 27 deletions
diff --git a/man3/atexit.3 b/man3/atexit.3
index 8122ddc32..4a57ac55a 100644
--- a/man3/atexit.3
+++ b/man3/atexit.3
@@ -11,7 +11,7 @@
.\" Modified 1993-07-24, Rik Faith (faith@cs.unc.edu)
.\" Modified 2003-10-25, Walter Harms
.\"
-.TH atexit 3 2023-02-05 "Linux man-pages 6.03"
+.TH atexit 3 2023-07-20 "Linux man-pages 6.05.01"
.SH NAME
atexit \- register a function to be called at normal process termination
.SH LIBRARY
@@ -61,37 +61,19 @@ it returns a nonzero value.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
-.ad l
-.nh
.TS
allbox;
lbx lb lb
l l l.
Interface Attribute Value
T{
+.na
+.nh
.BR atexit ()
T} Thread safety MT-Safe
.TE
-.hy
-.ad
.sp 1
-.SH STANDARDS
-POSIX.1-2001, POSIX.1-2008, C99, SVr4, 4.3BSD.
-.SH NOTES
-Functions registered using
-.BR atexit ()
-(and
-.BR on_exit (3))
-are not called if a process terminates abnormally because
-of the delivery of a signal.
-.PP
-If one of the registered functions calls
-.BR _exit (2),
-then any remaining functions are not invoked,
-and the other process termination steps performed by
-.BR exit (3)
-are not performed.
-.PP
+.SH VERSIONS
POSIX.1 says that the result of calling
.\" POSIX.1-2001, POSIX.1-2008
.BR exit (3)
@@ -109,6 +91,24 @@ portable programs should not invoke
.BR exit (3)
inside a function registered using
.BR atexit ().
+.SH STANDARDS
+C11, POSIX.1-2008.
+.SH HISTORY
+POSIX.1-2001, C89, C99, SVr4, 4.3BSD.
+.SH NOTES
+Functions registered using
+.BR atexit ()
+(and
+.BR on_exit (3))
+are not called if a process terminates abnormally because
+of the delivery of a signal.
+.PP
+If one of the registered functions calls
+.BR _exit (2),
+then any remaining functions are not invoked,
+and the other process termination steps performed by
+.BR exit (3)
+are not performed.
.PP
The
.BR atexit ()
@@ -137,28 +137,28 @@ that are called when the shared library is unloaded.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-
+\&
void
bye(void)
{
printf("That was all, folks\en");
}
-
+\&
int
main(void)
{
long a;
int i;
-
+\&
a = sysconf(_SC_ATEXIT_MAX);
printf("ATEXIT_MAX = %ld\en", a);
-
+\&
i = atexit(bye);
if (i != 0) {
fprintf(stderr, "cannot set exit function\en");
exit(EXIT_FAILURE);
}
-
+\&
exit(EXIT_SUCCESS);
}
.EE