[omniORB] errno and omnithreads

Duncan Grisby dgrisby@uk.research.att.com
Wed, 31 Oct 2001 15:01:33 +0000


On Friday 26 October, Mark Johnson wrote:

> My corba application also makes use of regular sockets.  I am createing all
> threads through the omni_thread class.  My question is will errno be
> threadsafe for use with threads doing socket stuff and can I simply #include
> <errno.h> or is there a specific header that I should include for using
> errno with omnithreads.

errno should be thread local. man errno on Linux, for example, says:

       errno  is defined by the ISO C standard to be a modifiable
       lvalue of type int, and must not be  explicitly  declared;
       errno  may  be a macro.  errno is thread-local; setting it
       in one thread does not  affect  its  value  in  any  other
       thread.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --