Date: Tue, 12 Oct 2004 15:33:36 +0200 (CEST) From: Jilles Tjoelker <jilles@stack.nl> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/72578: strerror_r() unrecognized error numbers not correctly documented Message-ID: <20041012133336.D939F22893@snail.stack.nl> Resent-Message-ID: <200410121340.i9CDeETE014414@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 72578 >Category: docs >Synopsis: strerror_r() unrecognized error numbers not correctly documented >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 12 13:40:14 GMT 2004 >Closed-Date: >Last-Modified: >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: >Unformatted:help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041012133336.D939F22893>
