9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / perror.3c
blob8834c75c5f0b8558bf43241b0336e36e699b914e
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PERROR 3C "Jul 12, 2007"
8 .SH NAME
9 perror, errno \- print system error messages
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <stdio.h>
15 \fBvoid\fR \fBperror\fR(\fBconst char *\fR\fIs\fR)
16 .fi
18 .LP
19 .nf
20 #include <errno.h>
22 int errno;
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 The \fBperror()\fR function produces a message on the standard error output
29 (file descriptor 2) describing the last error encountered during a call to a
30 system or library function. The argument string \fIs\fR is printed, followed by
31 a colon and a blank, followed by the message and a \fBNEWLINE\fR character.  If
32 \fIs\fR is a null pointer or points to a null string, the colon is not printed.
33 The argument string should include the name of the program that incurred the
34 error. The error number is taken from the external variable \fBerrno\fR, which
35 is set when errors occur but not cleared when non-erroneous calls are made. See
36 \fBIntro\fR(2).
37 .sp
38 .LP
39 In the case of multithreaded applications, the \fB-mt\fR option must be
40 specified on the command line at compilation time (see \fBthreads\fR(5)). When
41 the \fB-mt\fR option is specified, \fBerrno\fR becomes a macro that enables
42 each thread to have its own \fBerrno\fR. This \fBerrno\fR macro can be used on
43 either side of the assignment as though it were a variable.
44 .SH USAGE
45 .sp
46 .LP
47 Messages printed from this function are in the native language specified by the
48 \fBLC_MESSAGES\fR locale category.  See \fBsetlocale\fR(3C).
49 .SH ATTRIBUTES
50 .sp
51 .LP
52 See \fBattributes\fR(5) for descriptions of the following attributes:
53 .sp
55 .sp
56 .TS
57 box;
58 c | c
59 l | l .
60 ATTRIBUTE TYPE  ATTRIBUTE VALUE
62 Interface Stability     Standard
64 MT-Level        MT-Safe
65 .TE
67 .SH SEE ALSO
68 .sp
69 .LP
70 \fBIntro\fR(2), \fBfmtmsg\fR(3C), \fBgettext\fR(3C), \fBsetlocale\fR(3C),
71 \fBstrerror\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5), \fBthreads\fR(5)