Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

at_quick_exit - register function to run at process termination

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

C11
int at_quick_exit(void (*func) (void)); (End)

Description

at_quick_exit() registers a function func() to be called without arguments at quick process termination. The registered functions are called in the reverse order to that in which they were registered. Functions for which multiple registrations exist are called more than once.

Functions registered with at_quick_exit() are called only if the process is terminated by an explicit quick_exit() call.

Up to 40 functions can be registered.

Following a successful call to any of the exec functions, all functions previously registered by at_quick_exit() will no longer be registered.

Return val.

0

!= 0

if the function is registered successfully.

if an error occurs.

Notes

Functions registered by a call to at_quick_exit() must return to ensure that all registered functions are called.

The sysconf() function returns the value of ATEXIT_MAX, which specifies the total number of functions that can be registered. However, it is not possible to find out how many functions have already been registered (except by counting them).

See also

atexit(), exit(), quick_exit(), stdlib.h.