comerrno() - prints error message, given error code, and exits
comerrno(error,format,args);
int error;
char *format;
comerrno() is like comerr(), except that the caller supplies the error number.
Positive numbers are turned into system error messages. Negative numbers cause
the system error portion of the output to be omitted. comerrno() is a
convenient way to print the name of the program, and an error message, and
exit the process in a single call.
none
Rather than return, comerrno() exits the current process with a value equal to
the error number supplied by the user.
if (argc < 2)
comerrno(-1, "Usage: name arg.\n");
comerr(3), error(3), errmsg(3), error(3) geterrno(3), printf(3), format(3)
comerrno() attempts to find a line in the message file that corresponds to the
system error number. If none can be found, or if it has trouble finding or
reading the file, it simply says: error #.