57 lines
1.8 KiB
Groff
57 lines
1.8 KiB
Groff
. \" Manual Seite fuer comerr
|
|
. \" @(#)comerr.3 1.1
|
|
. \"
|
|
.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a
|
|
.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o
|
|
.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u
|
|
.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A
|
|
.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O
|
|
.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U
|
|
.if t .ds s \(*b
|
|
.if t .ds S SS
|
|
.if n .ds a ae
|
|
.if n .ds o oe
|
|
.if n .ds u ue
|
|
.if n .ds s sz
|
|
.TH COMERR 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS"
|
|
.SH NAME
|
|
comerr() \- prints error message and exits
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.B
|
|
comerr(format,arg1,\|.\|.\|.,argn)
|
|
.B char *format;
|
|
.fi
|
|
.SH 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 executing the process.
|
|
comerr() begins its output with the current program 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.
|
|
.SH RETURNS
|
|
none
|
|
.br
|
|
Rather than return, comerr() terminates the current process and
|
|
exits with the system error number as the exit code.
|
|
.SH EXAMPLES
|
|
.nf
|
|
if (( f = fileopen("file", "r")) == NULL)
|
|
comerr("Cannot open file.\\n");
|
|
.fi
|
|
.PP
|
|
On
|
|
.I stderr
|
|
it appears as:
|
|
.PP
|
|
.B
|
|
prog_name: No such file or directory. Cannot open file.
|
|
.SH "SEE ALSO"
|
|
comerrno(3), error(3), errmsg(3), error(3) geterrno(3), printf(3), format(3)
|
|
.SH 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 #.
|