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

NAME


at_quick_exit, quick_exit - terminate a running process with minimal
teardown

SYNOPSIS


#include <stdlib.h>

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

_Noreturn void
quick_exit(int status);

DESCRIPTION


The quick_exit() 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 at_quick_exit() 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 quick_exit() function will
terminate the calling program and its exit status will be status.

RETURN VALUES


The quick_exit() function does not return.

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

ERRORS


The at_quick_exit() function may fail if:

ENOMEM Insufficient storage space is available.

INTERFACE STABILITY


Standard

MT-LEVEL
Safe

SEE ALSO


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

illumos March 26, 2016 illumos