[Top][All Lists]

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

[lwip-devel] [bug #26121] Ability to retain per-thread socket error

From: Zhenwei Chu
Subject: [lwip-devel] [bug #26121] Ability to retain per-thread socket error
Date: Wed, 08 Apr 2009 20:00:00 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)


                 Summary: Ability to retain per-thread socket error
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: blackfin
            Submitted on: Wed 08 Apr 2009 07:59:59 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: Change Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.3.0



In a multi-threaded lwIP application multiple threads can issue high level
socket API calls. By default global errno is used to save the last error. Some
operating systems allow thread local storage that is thread specific which can
be used to store the error values. We have extended the sock_set_errno(sk,e)
macro to set the thread specific error as below. The new
set_thread_sock_err(e) sets the socket error in the thread local storage.

Files Changed:
In api\sockets.c, line 158

#define sock_set_errno(sk, e) do { \
      sk->err = (e); \
      set_errno(sk->err); \
} while (0)

void set_thread_sock_err(int);
#define sock_set_errno(sk, e) do { \
      sk->err = (e); \
      set_errno(sk->err); \
} while (0)

#ifndef ERRNO /* NOT ERRNO */
// For multithreaded environments error is set per thread.
void set_thread_sock_err(int err)


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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