error

Name

error -- print error message

Synopsis

void error (int exitstatus, int errnum, const char *format, ...)

Description

Print a message to standard error. First print the name of the program. If there is a function called error_print_progname (which would be provided by the application), call it to print the program name. If not, print the contents of the global variable program_name as the program name.

Then print a colon, a space, and the result of using the printf-style format and the optional arguments.

Then, if errnum is nonzero, print a colon, a space, and the result of strerror(errnum).

Then print a newline.

Then, if exitstatus is nonzero, call exit(exitstatus).