HTML automatically generated with rman
Table of Contents

Name

error, fatal, warning, recover, stop - handle errors and warnings and system exit

Synopsis


#include <stdinc.h>
void nemo_error(string format, ... )
void nemo_fatal(string format, ... )
void nemo_warning(string format, arg ... )
void nemo_recover(proc cleanup)
void nemo_stop(int lev)
void set_exit_level(int lev)

Description

NOTE: for compatibility error() (and friends) is still maintained via a macro in <stdinc.h>, but to avoid collisions with the GNU C library, our error() was renamed to nemo_error() (and friends).

error prints out an error string to stderr and calls stop, which normally exit’s the program (see also exit(3) ). A program can have recoverable errors by supplying the pointer to a user defined function, cleanup(), to recover. This functionality is similar to the signal(2) concept. No arguments can be given to the cleanup() function. After cleanup has been called the program continues. (hmmm) Any non-zero errno will also be reported.

fatal is like error, except calls abort(3) , which should cause a core dump.

warning prints out a warning string to stderr, but always continues the program.

Each of these functions converts, formats, and prints its args under control of the format, as described in printf(3) .

When debug_level is larger than 5 (see getparam(3NEMO) ) abort(3) is called, instead of exit(3) . This should create a coredump, if your coredumpsize is large enough.

stop exits to the system, similar to exit(3) , but performs some standard NEMO cleanup functions, for example, if the error count is non-zero (using the error= system keyword, see getparam(3NEMO) ), this function will return to the caller. If not, it exits to the sytem, using exit(3) , but also properly closes NEMOs parameter files using finiparam(3NEMO)

See Also

dprintf(3NEMO) , getparam(3NEMO) , exception(3NEMO) , exit(3) , abort(3) , varargs(3) , stdarg(3)

http://www.theiling.de/projects/liberror.html

http://www.flexiguided.de/publications.errhdl.en.html

AuthorJoshua Barnes, Peter Teuben History
xx-xxx-86    Created in the dark ages    Josh
4-oct-90    Upgraded with warning() and recover()    Peter
29-oct-90    abort for large enough debug_level    Peter
5-mar-94    documented stop                         peter
8-dec-01    added errno reporting, updated man page      peter
25-oct-2021    error -> nemo_error() for GNU C library linkking    PJT


Table of Contents