NAME
at_quick_exit —
register a function to to be called from
quick_exit()
SYNOPSIS
#include
<stdlib.h>
int at_quick_exit(void (*func)(void));
DESCRIPTION
[CX] The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1-2024 defers to the ISO C standard.
The at_quick_exit () function
shall register the function pointed to by
func, to be called
without arguments should quick_exit(3) be called. It is
unspecified whether a call to the at_quick_exit ()
function that does not happen before the quick_exit(3)
function is called will succeed.
At least 32 functions can be registered with
at_quick_exit ().
RETURN VALUE
Upon successful completion, at_quick_exit
() shall return 0; otherwise, it shall return a non-zero value.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
The at_quick_exit () function
registrations are distinct from the atexit(3)
registrations, so applications might need to call both registration
functions with the same argument.
The functions registered by a call to
at_quick_exit () must return to ensure that all
registered functions are called.
The application should call sysconf(3) to obtain
the value of {ATEXIT_MAX}, the number of functions that can be registered.
There is no way for an application to tell how many functions have already
been registered with at_quick_exit ().
Since the behavior is undefined if the
quick_exit(3) function is called more than once, portable
applications calling at_quick_exit () must ensure
that the quick_exit(3) function is not called when the
functions registered by the at_quick_exit ()
function are called.
If a function registered by the
at_quick_exit () function is called and a portable
application needs to stop further quick_exit(3)
processing, it must call the _exit(3) function or the
_Exit(3) function or one of the functions which cause
abnormal process termination.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
atexit(3), exec(3), exit(3), quick_exit(3), sysconf(3)
XBD <stdlib.h>
CHANGE HISTORY
First released in Issue 8. Included for alignment with the ISO/IEC 9899:2018 standard.