QUICK_EXIT(3C) Standard C Library Functions QUICK_EXIT(3C)

at_quick_exit, quick_exitterminate a running process with minimal teardown

#include <stdlib.h>

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

_Noreturn void
quick_exit(int status);

The () and at_quick_exit() functions provide a veneer around _Exit(2) that allows for registered functions to be called before terminating. Like _Exit(2), standard library termination is not done. atexit(3C) functions are not called and various standard termination that occurs when calling exit(3C) may not occur.

Functions that are registered with () will be called in reverse order upon calling quick_exit(). Functions registered with at_quick_exit() will not be called at any other time. Functions that are registered with at_quick_exit() should not make use of longjmp(3C) and related functions.

After calling all registered functions, the () function will terminate the calling program and its exit status will be status.

The quick_exit() function does not return.

The at_quick_exit() function returns on success. Otherwise, a non-zero error value is returned to indicate failure.

The at_quick_exit() function may fail if:

Insufficient storage space is available.

_Exit(2), atexit(3C), exit(3C), attributes(7), standards(7)

March 26, 2016 OmniOS