From bf44a819540d7cdf49a50cc9aca06df4a9774be5 Mon Sep 17 00:00:00 2001 From: kleink Date: Mon, 22 May 2006 21:40:33 +0000 Subject: [PATCH] Clarify that strerror() doesn't return EINVAL but stores in errno; prompted by Thomas Klausner. --- lib/libc/string/strerror.3 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3 index ccffc103c4c0..8d396e7ab1cd 100644 --- a/lib/libc/string/strerror.3 +++ b/lib/libc/string/strerror.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: strerror.3,v 1.12 2005/07/29 13:14:49 wiz Exp $ +.\" $NetBSD: strerror.3,v 1.13 2006/05/22 21:40:33 kleink Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -32,7 +32,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)strerror.3 8.1 (Berkeley) 6/9/93 -.Dd July 28, 2005 +.Dd May 22, 2006 .Dt STRERROR 3 .Os .Sh NAME @@ -99,17 +99,20 @@ a colon and space .Pq Dq Li ":\ " ; otherwise, only the error message string is printed. .Pp -If the error number is not recognized, these functions return an error message +If the error number is not recognized, these functions pass an error message string containing .Dq Li "Unknown error:\ " followed by the error number in decimal. -The +To warn about this, .Fn strerror +sets +.Dv errno +to +.Er EINVAL, and .Fn strerror_r -functions return -.Er EINVAL -as a warning. +returns +.Er EINVAL . Error numbers recognized by this implementation fall in the range 0 \*[Lt] .Fa errnum