.Dd\r
.Dt atexit 3\r
.Os\r
-\r
+.\"\r
.Sh NAME\r
.Nm atexit\r
.Nd registration of functions to be invoked before process termination\r
-\r
+.\"\r
.Sh SYNOPSIS\r
.In stdlib.h\r
.Fn "int atexit" "void (*handler)(void)"\r
.Fn "int at_quick_exit" "void (*handler)(void)" \r
(C11, C++11)\r
-\r
+.\"\r
.Sh DESCRIPTION\r
These functions register a function to be called when the corresponding process\r
exit function is invoked. For\r
.Fn at_quick_exit\r
the function will be invoked when the process is terminated by calling\r
.Fn quick_exit .\r
-\r
+.\"\r
.Pp\r
These functions are used in order to permit a program to perform actions before\r
a process is terminated; for example, releasing an interprocess semaphore. \r
is to support the abandonning of a process when normal process termination might\r
not be possible; at_quick_exit handlers should therefore be used sparingly and\r
only when their use is essential.\r
-\r
+.\"\r
.Pp\r
The standard guarantees that \r
.Fn atexit\r
and\r
.Fn at_quick_exit\r
may each be called at least 32 times successfully.\r
-\r
+.\"\r
.Pp\r
.Fn atexit \r
and\r
handlers are called in reverse order of the order they were registered in. For\r
precise details of their ordering, see\r
.Xr exit 3 .\r
-\r
+.\"\r
.Pp\r
The result of exiting from a handler registered with\r
.Fn atexit\r
should throw, \r
.Fn std::terminate\r
is invoked.\r
-\r
+.\"\r
.Pp\r
Undefined behaviour results if an \r
.Fn atexit\r
.Fn exit\r
or\r
.Fn quick_exit . \r
-\r
+.\"\r
.Sh RETURN VALUES\r
Returns 0 to indicate success; nonzero returns indicate failure.\r
-\r
+.\"\r
.Sh ERRORS\r
No errors are defined\r
-\r
+.\"\r
.Sh SEE ALSO\r
.Xr abort 3\r
.Xr exit 3\r
.Xr quick_exit 3\r
.Xr _Exit 3\r
-\r
+.\"\r
.Sh STANDARDS\r
.Fn atexit\r
is first defined in\r