|
NAMEexplain_exit - print an explanation of exit status before exitingSYNOPSIS#include <libexplain/libexplain.h>void explain_exit_on_exit(void);
DESCRIPTIONThe explain_exit_on_exit function may be used to have the calling program print an explanation of its exit status (the value passed to exit(3) or the return value from main) immediately before it terminates.The explain_exit_on_error function may be used to have the calling program print an explanation of its exit status immediately before it terminates, if that exit status is not EXIT_SUCCESS. The explain_exit_cancel function may be used to cancel the effect of the explain_exit_on_exit or explain_exit_on_error function. These functions may be called multiple times, and in any order. The last called has precedence. The explanation will never be printed more than once. Call Exit As NormalIn order to have the explanation printed, simply call exit(3) as normal, or return from main as normal. Do not call any of these functions in order to exit your program, they are called before you exit your program.CaveatThis functionality is only available on systems with the on_exit(3) system call. Unfortunately, the atexit(3) system call is not sufficiently capable, as it does not pass the exit status to the registered function.SEE ALSO
COPYRIGHTlibexplain version 1.3Copyright (C) 2009 Peter Miller AUTHORWritten by Peter Miller <pmiller@opensource.org.au> Visit the GSP FreeBSD Man Page Interface. |