Research V4 release
[unix-history] / man / man3 / perror.3
CommitLineData
d834b095
KT
1.th PERROR III 11/5/73
2.sh NAME
3perror \*- system error messages
4.sh SYNOPSIS
5.ft B
6perror(s)
7.br
8char *s;
9.s3
10int sys\*_nerr;
11.br
12char *sys\*_errlist[];
13.s3
14int errno;
15.ft R
16.br
17.sh DESCRIPTION
18.it Perror
19produces a short error message
20describing the last error encountered during a call
21to the system from a C program.
22First the argument string
23.it s
24is printed, then a colon, then the message and a new-line.
25Most usefully, the argument string is the name
26of the program which incurred the error.
27The error number is taken from the external variable
28.it errno,
29which is set when errors occur but not cleared when
30non-erroneous calls are made.
31.s3
32To simplify variant formatting
33of messages, the vector of message strings
34.it sys\*_errlist
35is provided;
36.it errno
37can be used as an index in this table to get the
38message string without the newline.
39.it Sys\*_nerr
40is the largest message number provided for in the table;
41it should be checked because new
42error codes may be added to the system before
43they are added to the table.
44.sh "SEE ALSO"
45Introduction to System Calls
46.sh BUGS