From owner-freebsd-doc@FreeBSD.ORG Tue Oct 12 13:40:26 2004 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBACA16A4CE for ; Tue, 12 Oct 2004 13:40:25 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C97DD43D39 for ; Tue, 12 Oct 2004 13:40:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9CDeED4014419 for ; Tue, 12 Oct 2004 13:40:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9CDeETE014414; Tue, 12 Oct 2004 13:40:14 GMT (envelope-from gnats) Resent-Date: Tue, 12 Oct 2004 13:40:14 GMT Resent-Message-Id: <200410121340.i9CDeETE014414@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jilles Tjoelker Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BF7216A546 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/72578: strerror_r() unrecognized error numbers not correctly documented X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jilles Tjoelker List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2004 13:40:26 -0000 >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: