Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
COMERRNO(3)		  Schily's LIBRARY FUNCTIONS		   COMERRNO(3)

NAME
       comerrno() - prints error message, given	error code, and	exits

SYNOPSIS
       comerrno(error,format,args);
       int error;
       char *format;

DESCRIPTION
       comerrno()  is like comerr(), except that the caller supplies the error
       number. Positive	numbers	are turned into	system error  messages.	 Nega-
       tive  numbers  cause the	system error portion of	the output to be omit-
       ted.  comerrno()	is a convenient	way to print the name of the  program,
       and an error message, and exit the process in a single call.

RETURNS
       none
       Rather  than  return, comerrno()	exits the current process with a value
       equal to	the error number supplied by the user.

EXAMPLES
       if (argc	< 2)
	    comerrno(-1, "Usage: name arg.\n");

SEE ALSO
       comerr(3), error(3), errmsg(3), error(3)	geterrno(3),  printf(3),  for-
       mat(3)

NOTES
       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 #.

Joerg Schilling			 15. Juli 1988			   COMERRNO(3)

NAME | SYNOPSIS | DESCRIPTION | RETURNS | EXAMPLES | SEE ALSO | NOTES

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=comerrno&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help