error

Name

error -- print error message

Synopsis

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

Description

error prints a message to standard error.

error builds the message from the following elements in their specified order:

  1. the program name. If the application has provided a function named error_print_progname, error calls this to supply the program name; otherwise, error uses the content of the global variable program_name.

  2. the COLON and SPACE characters, then the result of using the printf-style format and the optional arguments.

  3. if errnum is non-ZERO, error adds the COLON and SPACE characters, then the result of strerror(errnum).

  4. a newline.

If exitstatus is non-ZERO, error calls exit(exitstatus).