PERROR(3) BSD PERROR(3)
NAME
perror, sys_errlist, sys_nerr - system error messages
SYNOPSIS
perror(s)
char *s;
int sys_nerr;
char *sys_errlist[];
DESCRIPTION
perror produces a short error message on the standard error file that
describes the error that a C program encountered during its most recent
call to the system. perror prints the argument string s first, then a
colon, then the message and a newline. The most useful argument string
would be the name of the program that incurred the error. The error
number is taken from the external variable errno (see intro(2)). errno
is set when errors occur, but it is not cleared by successful calls.
To simplify creation of variant formats, the vector of message strings
sys_errlist is provided. errno can be used as an index in this table to
get the message string without the newline. sys_nerr is the number of
messages provided for in the table; it should be checked because new
error codes may be added to the system before they are added to the
table.
NOTES
More verbose, Domain/OS-specific error messages may be obtained by
setting the environment variable "APOLLO_STATUS" to "true".
SEE ALSO
intro(2), psignal(3)