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

FreeBSD Manual Pages

  
 
  

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

NAME
       comerr()	- prints error message and exits

SYNOPSIS
       comerr(format,arg1,...,argn)
       char *format;

DESCRIPTION
       comerr()	 formats and prints a message on the error output stream. Part
       of the message is the last error	encountered by the system  while  exe-
       cuting  the  process.  comerr() begins its output with the current pro-
       gram name (as passed to it by exec() ) followed by a colon ":" and  the
       detailed	system error message. It then formats the user supplied	format
       string and arguments in the form	printf() would.

RETURNS
       none
       Rather than return, comerr() terminates the current process  and	 exits
       with the	system error number as the exit	code.

EXAMPLES
       if (( f = fileopen("file", "r"))	== NULL)
	    comerr("Cannot open	file.\n");

       On stderr it appears as:

       prog_name: No such file or directory. Cannot open file.

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

NOTES
       comerr()	attempts to find a line	in the message file  that  corresponds
       to  the	system	error  number. If none can be found, or	it has trouble
       finding or reading the file, it simply says: error #.

Joerg Schilling			 15. Juli 1988			     COMERR(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=comerr&sektion=3&manpath=FreeBSD+13.1-RELEASE+and+Ports>

home | help