[netcf-devel] strerror thread-safety? [was: [PATCH 1/2] Windows port - routines patch]

Eric Blake eblake at redhat.com
Mon Nov 8 20:48:03 UTC 2010


[adding bug-gnulib]

On 11/08/2010 12:23 PM, Daniel P. Berrange wrote:
> On Mon, Nov 08, 2010 at 02:02:06PM -0500, Adam Stokes wrote:
>> +
>> +char *strerror_r(int errnum, char *buf, size_t buflen) {
>> +    return strerror(errnum);
>> +}
> 
> strerror() is absolutely not threadsafe, so this is dangerous.

strerror_r has its own set of portability problems, since the glibc
signature disagrees with the POSIX signature.  It also has not yet been
ported to gnulib (in either the POSIX or glibc variant).  That might be
a useful project to tackle first.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
Url : https://fedorahosted.org/pipermail/netcf-devel/attachments/20101108/12309bbf/attachment-0001.bin 


More information about the netcf-devel mailing list