]> git.saurik.com Git - apple/libc.git/blobdiff - string/FreeBSD/strerror.3
Libc-1081.1.3.tar.gz
[apple/libc.git] / string / FreeBSD / strerror.3
index 1462c657dea67526680a4804a5932f557c61200c..f6f7510d64bf0abe539d22eafb1ff8f956c9baa7 100644 (file)
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\"    must display the following acknowledgement:
-.\"    This product includes software developed by the University of
-.\"    California, Berkeley and its contributors.
 .\" 4. Neither the name of the University nor the names of its contributors
 .\"    may be used to endorse or promote products derived from this software
 .\"    without specific prior written permission.
@@ -34,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)strerror.3 8.1 (Berkeley) 6/9/93
-.\" $FreeBSD: src/lib/libc/string/strerror.3,v 1.22 2002/12/19 10:24:52 tjr Exp $
+.\" $FreeBSD: src/lib/libc/string/strerror.3,v 1.24 2007/01/09 00:28:12 imp Exp $
 .\"
-.Dd December 19, 2002
+.Dd October 12, 2004
 .Dt STRERROR 3
 .Os
 .Sh NAME
 .Sh SYNOPSIS
 .In stdio.h
 .Ft void
-.Fn perror "const char *string"
+.Fo perror
+.Fa "const char *s"
+.Fc
 .Vt extern const char * const sys_errlist[] ;
 .Vt extern const int sys_nerr ;
 .In string.h
 .Ft "char *"
-.Fn strerror "int errnum"
+.Fo strerror
+.Fa "int errnum"
+.Fc
 .Ft int
-.Fn strerror_r "int errnum" "char *strerrbuf" "size_t buflen"
+.Fo strerror_r
+.Fa "int errnum"
+.Fa "char *strerrbuf"
+.Fa "size_t buflen"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn strerror ,
-.Fn strerror_r
+.Fn strerror_r ,
 and
 .Fn perror
 functions look up the error message string corresponding to an
@@ -92,7 +96,7 @@ value of the global variable
 and writes it, followed by a newline, to the
 standard error file descriptor.
 If the argument
-.Fa string
+.Fa s
 is
 .Pf non- Dv NULL
 and does not point to the null character,
@@ -102,20 +106,19 @@ a colon and space
 .Pq Dq Li ":\ " ;
 otherwise, only the error message string is printed.
 .Pp
-If
-.Fa errnum
-is not a recognized error number,
-.Fn strerror
-returns an error message string containing
+If the error number is not recognized, these functions return an error message
+string containing
 .Dq Li "Unknown error:\ "
-followed by the error number in decimal, while
+followed by the error number in decimal.
+The
+.Fn strerror
+and
 .Fn strerror_r
-leaves
-.Fa strerrbuf
-unchanged and returns
-.Er EINVAL .
+functions return
+.Er EINVAL
+as a warning.
 Error numbers recognized by this implementation fall in
-the range 0 <
+the range 0 <=
 .Fa errnum
 <
 .Fa sys_nerr .