Unix and Linux Discussions Tagged with explanation |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
3 |
1,625 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
2,595 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
22,991 |
AIX |
|
|
|
3 |
1,459 |
Shell Programming and Scripting |
|
|
|
1 |
2,641 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,753 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
1,806 |
Shell Programming and Scripting |
|
|
|
9 |
15,247 |
Shell Programming and Scripting |
|
|
|
1 |
12,827 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
16,034 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
13,648 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,307 |
UNIX for Advanced & Expert Users |
|
|
|
6 |
4,287 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,663 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
6,240 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,861 |
UNIX for Dummies Questions & Answers |
explain_exit(3) Library Functions Manual explain_exit(3)
NAME
explain_exit - print an explanation of exit status before exiting
SYNOPSIS
#include <libexplain/libexplain.h>
void explain_exit_on_exit(void);
void explain_exit_on_error(void);
void explain_exit_cancel(void);
DESCRIPTION
The 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 Normal
In 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.
Caveat
This functionality is only available on systems with the on_exit(3) system call. Unfortunately, the atexit(3) system call is not suffi-
ciently capable, as it does not pass the exit status to the registered function.
SEE ALSO
exit(3) cause normal process termination
atexit(3)
register a function to be called at normal process termination
on_exit(3)
register a function to be called at normal process termination
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
AUTHOR
Written by Peter Miller <pmiller@opensource.org.au>
explain_exit(3)