'\"macro stdmacro
.if n .pH g3c.perror @(#)perror	40.13 of 10/27/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} perror 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} perror 3C "C Programming Language Utilities"
.if \nX=2 .ds x} perror 3C "" "\&"
.if \nX=3 .ds x} perror "" "" "\&"
.TH \*(x}
.SH NAME
\f4perror\f1 \- print system error messages
.SH SYNOPSIS
\f4#include <stdio.h>\f1
.PP
\f4void perror (const char \(**s);\f1
.PP
.SH DESCRIPTION
\f4perror\fP
produces a message on the standard error output (file descriptor 2),
describing the last error encountered
during a call to a system or library function.
The argument string
.I s\^
is printed first, then a colon and a blank, then the message and a newline.
(However, if
.I s
is a null pointer or points to a null string,
the colon is not printed.)
To be of most use, the argument string should include the name
of the program that incurred the error.
The error number is taken from the external variable
\f4errno\f1, which is set when errors occur but not cleared when
non-erroneous calls are made.
.SH SEE ALSO
\f4intro\fP(2), \f4fmtmsg\f1(3C), \f4strerror\fP(3C).
.\"	@(#)perror.3c	6.2 of 10/20/83
.Ee
