On Wed, Apr 28, 1999 at 12:27:49PM +0200, Niels Poppe wrote:
> Ulrich Drepper wrote:
>> [EMAIL PROTECTED] (Bodo Moeller) writes:
>>> Turns out that the Linux-specific parts of glibc 2.1 doesn't pay
>>> attention to the standards in the first place and _always_ defines
>>> errno to be that macro. So, unless (or until) there are also correct
>>> versions of the library, -D_REENTRANT is not needed on Linux with
>>> glibc.
>> Somebody who has no clue about these things shouldn't make such
>> comments. Errno is explicitly *always* allowed to be a macro and
>> _REENTRANT is not defined in any standard. So, everything you wrote
>> is completely wrong.
> Excuse me for possibly being clueless on this. Observing openssl
> libraries linked against glibc-2.0.7 I see the following:
> compiling with -D_REENTRANT -DTHREADS generates symbol U
> __errno_location
> compiling without these generates symbol U errno
>
> The definition of __errno_location is in libc.so.6 as as 'weak'
> symbol, and also in libpthread.so.0 as an 'absolute' symbol.
> Therefore linking applications with openssl without -lpthread
> will take the definition in libc, but -lpthread will overrride
> this (with the thread-specific value?).
>
> I don't have glibc 2.1 around, so I can't comment on that but for
> normal linux compilations I'd say making thread-safe libraries
> should be the default. That is, *with* -D_REENTRANT.
Yes, I think so. Ulrich (of course?) is absolutely right that even in
standard C without extensions errno need not be a variable. I don't
know where I got the idea that the function-calling macro is is not
legal for standard C. But often, _REENTRANT is necessary to get the
definition that works for threads (e.g. for SunOS 5.6, and according
to your observations also for glibc-2.0.7 on Linux; and the
LinuxThreads library's FAQ is full of warnings that one never should
forget to define it). I have no idea whether the pthreads
*specification* comments on whether you may have to define special
preprocessor symbols to use pthreads.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]