Bell 32V release
[unix-history] / usr / man / man3 / perror.3
CommitLineData
c4665c80
TL
1.TH PERROR 3
2.SH NAME
3perror, sys_errlist, sys_nerr \- system error messages
4.SH SYNOPSIS
5.B perror(s)
6.br
7.B char *s;
8.PP
9.B int sys_nerr;
10.br
11.B char *sys_errlist[];
12.SH DESCRIPTION
13.I Perror
14produces a short error message
15on the standard error file
16describing the last error encountered during a call
17to the system from a C program.
18First the argument string
19.I s
20is printed, then a colon, then the message and a new-line.
21Most usefully, the argument string is the name
22of the program which incurred the error.
23The error number is taken from the external variable
24.I errno
25(see
26.IR intro (2)),
27which is set when errors occur but not cleared when
28non-erroneous calls are made.
29.PP
30To simplify variant formatting
31of messages, the vector of message strings
32.I sys_errlist
33is provided;
34.I errno
35can be used as an index in this table to get the
36message string without the newline.
37.I Sys_nerr
38is the number of messages provided for in the table;
39it should be checked because new
40error codes may be added to the system before
41they are added to the table.
42.SH "SEE ALSO"
43intro(2)