This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: __xpg_strerror_r should not clobber strerror buffer
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Sat, 21 May 2011 21:35:14 -0400
- Subject: Re: __xpg_strerror_r should not clobber strerror buffer
- References: <4DD8664D.2000407@redhat.com>
- Reply-to: cygwin-patches at cygwin dot com
On Sat, May 21, 2011 at 07:26:37PM -0600, Eric Blake wrote:
>POSIX says that no other function in the standard should clobber the
>strerror buffer. Our strerror_r is a GNU extension, so it can get away
>with clobbering the buffer (but if we wanted to fix it, we would have to
>separate _my_tls.locals.strerror_buf into two different buffers).
>perror() is still broken, but that needs to be fixed in newlib. But
>__xpg_strerror_r, which is our POSIX strerror_r variant, has to be fixed
>in cygwin.
>
>Meanwhile, glibc just patched strerror this week to print negative
>errnum as a negative 32-bit int, rather than as a positive unsigned
>long; cygwin should do likewise.
>
>2011-05-21 Eric Blake <eblake@redhat.com>
>
> * errno.cc (strerror): Print unknown errno as int.
> (__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
Looks good. Please check in.
Thanks.
cgf