Table of Contents


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


#include <stdinc.h>
void error(string format, ... )
void fatal(string format, ... )
void warning(string format, arg ... )
void recover(proc cleanup)
void stop(int lev)
void set_exit_level(int lev)


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)

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

Table of Contents