On Mon, Jan 21, 2008 at 05:34:43PM -0800, David Schwartz wrote:
> > - there is no difference between
> > multithreaded and non-multithreaded _compilation_ (surely not for errno
> > and malloc).

>
> Really? So 'errno' refers to a process global in both cases?! (Note that I
> said the "definition", not the implementation.)


If your glibc (only) supports NPTL, which is the case for recent
versions, errno is defined like this:
# define errno (*__errno_location ())

errno is stored in Thread Local Storage (TLS). You can't link to the
global errno anymore.

Using "extern int errno" will actually result in a linking error:
/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference


Kurt

__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org