provide __xpg_strerror_r

Eric Blake eblake@redhat.com
Sat Feb 5 20:04:00 GMT 2011


Our strerror_r is lousy (it doesn't even match glibc's behavior); see my
request to the newlib list.  But even if newlib swaps over to a
POSIX-compliant strerror_r, I argue that for Linux compatibility (not to
mention backwards compatibility with existing programs), we need to
continue to provide strerror_r with the glibc signature (and I will make
sure of that when writing the newlib patch to whatever the consensus is
there).

Meanwhile, gnulib really wants to use the POSIX interface; on glibc
systems, it uses the __xpg_strerror_r interface (undeclared, but that's
what you get with a leading double-underscore interface), when
_POSIX_C_VERSION is high enough and _GNU_SOURCE is not in effect.

Since __xpg_strerror_r is undeclared, we don't have to care about tweaking
newlib's string.h for this patch (gnulib does a link-test probe for its
existence).

2011-02-05  Eric Blake  <eblake@redhat.com>

	* errno.cc (__xpg_strerror_r): New function.
	* cygwin.din: Export it.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch39
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110205/0b67b6c6/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 616 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110205/0b67b6c6/attachment.sig>


More information about the Cygwin-patches mailing list