.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)perror.3 6.4 (Berkeley) 6/24/90
.TH PERROR 3 "June 24, 1990"
perror, strerror, sys_errlist, sys_nerr \- system error messages
.B extern int errno, sys_nerr;
.B extern char *sys_errlist[];
produces a short error message on the standard error file
describing the last error encountered during a call
to the system from a C program. If
is non-NULL, it is printed, followed by a colon, followed by a space,
followed by the message and a new-line. Otherwise, just the
message and the new-line are printed. Most usefully, the argument
string is the name of the program which incurred the error.
The error number is taken from the external variable
which is set when errors occur but not cleared when
non-erroneous calls are made.
To simplify variant formatting of messages, the
function returns a pointer to the error message string mapped
The message strings can be accessed directly using the external
is the total number of messages in the array. The use of these