bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eric Blake
Subject: strerror thread-safety? [was: [netcf-devel] [PATCH 1/2] Windows port - routines patch]
Date: Mon, 08 Nov 2010 13:48:03 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc14 Mnenhy/0.8.3 Thunderbird/3.1.6

[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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]