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: __xpg_strerror_r should not clobber strerror buffer


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


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