provide __xpg_strerror_r

Corinna Vinschen corinna-cygwin@cygwin.com
Sun Feb 6 09:54:00 GMT 2011


On Feb  5 13:43, Eric Blake wrote:
> 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?

It would be better if we implement strerror_r locally, in two versions,
just as on Linux.  I think the best approach is to implement this in
newlib first (I replied to your mail there) and then, given that we use
the newlib string.h, copy the method over to Cygwin to match our current
strerror more closely.

Does that make sense?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-patches mailing list