From owner-freebsd-standards Wed Dec 5 8:13:35 2001 Delivered-To: freebsd-standards@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 538E137B422 for ; Wed, 5 Dec 2001 08:13:14 -0800 (PST) Received: from mail.rpi.edu (root@mail.rpi.edu [128.113.22.40]) by khavrinen.lcs.mit.edu (8.11.4/8.11.4) with ESMTP id fB5GDDG01489 for ; Wed, 5 Dec 2001 11:13:13 -0500 (EST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id fB5GCir79652; Wed, 5 Dec 2001 11:12:48 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <3C0DDA2E.8B6C3117@softweyr.com> References: <20011203005459.N8502-100000@gamplex.bde.org> <3C0D0995.A7FEFB47@softweyr.com> <3C0DDA2E.8B6C3117@softweyr.com> Date: Wed, 5 Dec 2001 11:12:42 -0500 To: Wes Peters From: Garance A Drosihn Subject: Re: strerror_r() implementation Cc: Bruce Evans , Bill Fenner , mike@FreeBSD.org, freebsd-standards@bostonradio.org Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 1:26 AM -0700 12/5/01, Wes Peters wrote: >Actually, in the new, improved implementation, if strerror_r touches >strerrbuf at all, it will copy in a null-terminated string bearing >the first 'len' characters from one of the sys_errlst messages. If the >string was truncated, it is still nul-terminated but ERANGE is returned. >If errnum is not a known value for errno, EINVAL is returned and strerrbuf >is *untouched.* This attempts to be strictly compatible with POSIX. > >strerror cannot encounter a 'not enough room' error; it either returns >a pointer one of the messages from sys_errlst, or a pointer to an >internal buffer that contains the message "Unknown error: {num}" that >is sized such that it cannot fail. > >Does this seem OK? Well, this sounds pretty good to me. I have no suggestions which might make it better. Thanks. I will now tiptoe away quietly... :-) -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message