.TH perror() "" "" "General Function (libc)"
.PC "System call error messages"
\fB#include <errno.h>\fR
\fBperror(\fIstring\^\fB)\fR
\fBchar *\fIstring\^\fB; extern int \fIsys_nerr\^\fB;\fR \fBextern char *\fIsys_errlist\^\fB[];\fR
.PP
.B perror()
prints an error message on the standard error device.
The message consists of the argument
.IR string ,
followed by a brief description of
the last system call that failed.
The external variable
.B errno
contains the last error number.
Normally,
.I string
is the perror of the command that failed or a file perror.
.PP
The external array
.B sys_errlist
gives the list of messages used by
.BR perror() .
The external
.B sys_nerr
gives the number of messages in the list.
.SH "See Also"
.Xr "errno," errno
.Xr "errno.h," errno.h
.Xr "libc" libc
.br
\*(AS, \(sc7.9.10.4
.br
\*(PX Standard, \(sc8.1
