Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2001 11:12:42 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        Wes Peters <wes@softweyr.com>
Cc:        Bruce Evans <bde@zeta.org.au>, Bill Fenner <fenner@research.att.com>, mike@FreeBSD.org, freebsd-standards@bostonradio.org
Subject:   Re: strerror_r() implementation
Message-ID:  <p05101001b833f3176620@[128.113.24.47]>
In-Reply-To: <3C0DDA2E.8B6C3117@softweyr.com>
References:  <20011203005459.N8502-100000@gamplex.bde.org>	 <3C0D0995.A7FEFB47@softweyr.com> <p0510100cb832c9f7c119@[128.113.24.47]> <3C0DDA2E.8B6C3117@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05101001b833f3176620>