Subject: Re: Usage of errno and thread-safety

Re: Usage of errno and thread-safety

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 11 Mar 2011 19:02:24 +0100 (CET)

On Fri, 11 Mar 2011, Sebastien Fricker wrote:

> But I'm guessing if it is not possible to get rid of errno: errno is a
> global error information that contain an error code but not systematically
> from the actual socket.

What are you talking about?

First, why would removing errno be a priority at all? errno is defined by
POSIX to be thread-safe *and* recv and send both are documented (and proven)
to provide additional error information in that variable after a failure.

> Using this variable makes libssh2 not thread safe.

What platform do you claim this is true for?

> I'm not sure if this code works.

So you're suggesting we introduce code you don't know if it works? (and yes,
it will buffer overflow on many systems if the socket descriptor is above
1024)

-- 
  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-03-11