From owner-freebsd-questions Wed Aug 21 13:21:21 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6474137B400 for ; Wed, 21 Aug 2002 13:21:16 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3FB343E81 for ; Wed, 21 Aug 2002 13:21:15 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g7LKLFYU090353; Wed, 21 Aug 2002 15:21:15 -0500 (CDT) (envelope-from dan) Date: Wed, 21 Aug 2002 15:21:15 -0500 From: Dan Nelson To: Lance Bland Cc: questions@FreeBSD.ORG Subject: Re: is errno thread safe? (was Re: Porting from win32 to UNIX: Sockets) Message-ID: <20020821202114.GE97484@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Aug 21), Lance Bland said: > hi- > > is errno thread safe? man errno: Nearly all of the system calls provide an error number referenced via the external identifier errno. This identifier is defined in as extern int * __error(); #define errno (* __error()) The __error() function returns a pointer to a field in the thread specific structure for threads other than the initial thread. For the initial thread and non-threaded processes, __error() returns a pointer to a global errno variable that is compatible with the previous definition. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message