[PATCH] Change strerror_r definition for cygwin

Corinna Vinschen vinschen@redhat.com
Fri Aug 26 08:43:00 GMT 2005

On Aug 25 22:18, Christopher Faylor wrote:
> On Thu, Aug 25, 2005 at 07:03:42PM -0400, Christopher Faylor wrote:
> >It seems like newlib's strerror_r implementation is not compliant with
> >standards.  We need to have strerror_r return an integer for cygwin so
> >I've made the change below.
> >
> >OTOH, if this change should be the default, let me know and I'll be
> >happy to change libc/string/strerror_r.c .
> Sorry about that.  Apparently it isn't that simple.  There are two
> differing implementations of strerror_r and newlib is emulating the
> default linux version.

But the Linux man page has this to say:

   SVID 3, POSIX, BSD 4.3, ISO/IEC 9899:1990 (C89).

   strerror_r() with prototype as given above is specified by SUSv3,  [...]
   An incompatible function, with prototype

     char *strerror_r(int errnum, char *buf, size_t n);

   is a GNU extension used by glibc (since 2.0), and must be regarded  as
   obsolete in view of SUSv3."

I like the sound of the word "obsolete".


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.

More information about the Newlib mailing list