provide __xpg_strerror_r

Eric Blake eblake@redhat.com
Sat Feb 5 20:45:00 GMT 2011


On 02/05/2011 01:28 PM, Christopher Faylor wrote:
> On Sat, Feb 05, 2011 at 01:04:16PM -0700, Eric Blake wrote:
>> Our strerror_r is lousy (it doesn't even match glibc's behavior); see my
>> request to the newlib list.
> 
> We really should just implement strerror_r in errno.cc.  It doesn't make
> sense to have two different implementations

You mean, implement the POSIX interface for strerror_r in errno.cc, and
ditch glibc compatibility?  But, backwards compatibility demands that we
have two interfaces - the glibc one that returns char* for satisfying
the link demands of existing applications, and the POSIX one that
returns int, so we really are stuck with providing two forms of
strerror_r if we intend to comply with POSIX.

We already provide our own strerror() (it provides a better experience
for out-of-range values that the newlib interface), but we're currently
using the newlib strerror_r() (in spite of its truncation flaw).

How should I rework this patch?

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110205/d081461e/attachment.sig>


More information about the Cygwin-patches mailing list