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

Laine Stump laine at laine.org
Tue Nov 9 17:42:04 UTC 2010


On 11/08/2010 03:48 PM, Eric Blake wrote:
> [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.

Fortunately, strerror_r() is only used by netcf in the run_program() 
function, which is linux-specific, so this isn't really needed at all 
anyway (right now).




More information about the netcf-devel mailing list