Subject: Re: getpw*_r standards
To: John Nemeth <jnemeth@victoria.tc.ca>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: current-users
Date: 04/11/2005 11:32:17
jnemeth@victoria.tc.ca (John Nemeth) writes:

>      Is errno defined in such a way that it is a per thread
>      variable,

Yes, errno is defined to be a per-thread variable (specifically, errno
is #defined in <errno.h> to be "(*__errno())", and the __errno()
function returns a pointer to the per-thread errno storage. It's done
this way specifically because of the large number of functions that
would be reentrant except for this issue. It's still considered better
modern style to return the error code directly.

        - Nathan