__xpg_strerror_r should not clobber strerror buffer
Sun May 22 01:35:00 GMT 2011
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
>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 <email@example.com>
> * errno.cc (strerror): Print unknown errno as int.
> (__xpg_strerror_r): Likewise, and don't clobber strerror buffer.
Looks good. Please check in.
More information about the Cygwin-patches