This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: provide __xpg_strerror_r


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]