From jilles@stack.nl  Tue Oct 12 13:33:38 2004
Return-Path: <jilles@stack.nl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4BF7216A546
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2004 13:33:38 +0000 (GMT)
Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140])
	by mx1.FreeBSD.org (Postfix) with ESMTP id DA1BC43D31
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2004 13:33:37 +0000 (GMT)
	(envelope-from jilles@stack.nl)
Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131])
	by mailhost.stack.nl (Postfix) with ESMTP id EE6281F4BB
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2004 15:33:36 +0200 (CEST)
Received: by snail.stack.nl (Postfix, from userid 1677)
	id D939F22893; Tue, 12 Oct 2004 15:33:36 +0200 (CEST)
Message-Id: <20041012133336.D939F22893@snail.stack.nl>
Date: Tue, 12 Oct 2004 15:33:36 +0200 (CEST)
From: Jilles Tjoelker <jilles@stack.nl>
Reply-To: Jilles Tjoelker <jilles@stack.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: strerror_r() unrecognized error numbers not correctly documented
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72578
>Category:       docs
>Synopsis:       strerror_r() unrecognized error numbers not correctly documented
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 12 13:40:14 GMT 2004
>Closed-Date:    Sat Nov 20 00:07:36 GMT 2004
>Last-Modified:  Sat Nov 20 00:07:36 GMT 2004
>Originator:     Jilles Tjoelker
>Release:        FreeBSD 5.2.1-RELEASE-p11 i386
>Organization:
MCGV Stack
>Environment:
System: FreeBSD snail.stack.nl 5.2.1-RELEASE-p11 FreeBSD 5.2.1-RELEASE-p11 #2: Tue Oct 5 16:23:22 CEST 2004 snowball@snail.stack.nl:/usr/obj/usr/src/sys/SNAIL i386
also in RELENG_5 and HEAD
>Description:
According to man strerror_r, strerror_r() does not change the buffer in case of
an invalid error number. Actually, it does, and this functionality is being
used, for example in the patch in PR standards/72394. It seems more useful.
>How-To-Repeat:
man strerror_r
>Fix:
patch included

--- strerror.3.patch begins here ---
--- src/lib/libc/string/strerror.3.orig	Tue Oct 12 14:59:18 2004
+++ src/lib/libc/string/strerror.3	Tue Oct 12 15:13:08 2004
@@ -36,7 +36,7 @@
 .\"     @(#)strerror.3	8.1 (Berkeley) 6/9/93
 .\" $FreeBSD: /repoman/r/ncvs/src/lib/libc/string/strerror.3,v 1.7.2.7 2003/01/17 13:39:50 mike Exp $
 .\"
-.Dd December 19, 2002
+.Dd October 12, 2004
 .Dt STRERROR 3
 .Os
 .Sh NAME
@@ -102,18 +102,17 @@
 .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 <
 .Fa errnum
--- strerror.3.patch ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: keramida 
State-Changed-When: Tue Oct 12 14:53:03 GMT 2004 
State-Changed-Why:  
Patch committed to CURRENT.  Thanks :-) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72578 
Responsible-Changed-From-To: freebsd-doc->keramida 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Tue Oct 12 14:59:52 GMT 2004 
Responsible-Changed-Why:  
Grab this PR as a reminder for me that I have an MFC to do. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72578 
State-Changed-From-To: patched->closed 
State-Changed-By: keramida 
State-Changed-When: Sat Nov 20 00:04:54 GMT 2004 
State-Changed-Why:  
Merged to RELENG_4 and RELENG_5.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72578 
>Unformatted:
