"Karlsson, Johnny" <[email protected]> wrote:

Ok, that seems much better. But one more question .. You write that
there is a global variable 'errno', but isn't there one errno variable
for each socket?

Normally there should be no need for that since 'errno' should
only be checked immediately after any socket (or system) function fails
(returning '< 0' normally). 'errno' is undefined at other times. But in the case your OS or application is multithreaded, 'errno' should return correct value for the thread in question. Otherwise a race condition occurs. The definition of 'errno' (a macro on Windows) should consider this.

E.g. for Coldfire:

#define errno (*sys_arch_errno())
...

int *sys_arch_errno(void)
{
   struct sys_thread *thread;
   thread = current_thread();
   return &thread->errno_i;
}

--gv

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to