bug-gnulib
[Top][All Lists]
Advanced

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

Re: lock module question


From: Simon Josefsson
Subject: Re: lock module question
Date: Wed, 05 Mar 2008 17:55:01 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Yoann Vandoorselaere <address@hidden> writes:

> Le mercredi 05 mars 2008 à 16:34 +0100, Simon Josefsson a écrit :
>> Yoann Vandoorselaere <address@hidden> writes:
>> 
>> > Using -pthread allow option like -D_REENTRANT to be defined when
>> > compiling Gnulib, which sound like a requirement if the program using
>> > Gnulib is multithreaded.
>> 
>> Why do you feel a need to use -D_REENTRANT?  When I looked into it
>> recently, I decided to remove -D_REENTRANT from gnutls because it didn't
>> seem like it was needed anymore.  glibc manual:
>
> [...]
>
>> Looking into my /usr/include, I could only find that it matters for
>> getlogin_r*.
>> 
>> I know debian has a policy to add _REENTRANT but their justification
>> seem to have been linux-threads.  I don't know if it is needed any more.
>> 
>> If someone could shred any light why you really would want to use
>> _REENTRANT, that would be helpful.
>
> One reason to use _REENTRANT is per thread localized errno:
>
> #  if !defined _LIBC || defined _LIBC_REENTRANT
> /* When using threads, errno is a per-thread value.  */
> #   define errno (*__errno_location ())
> #  endif

That uses _LIBC_REENTRANT, and as far as I can see, its value isn't
influenced by _REENTRANT through any header file at least.

> Additionally, although there might be no problem under popular
> architecture, are we certain that not using the appropriate CFLAGS won't
> give undefined results under other architectures?

No, but we'll never find out if we keep on using it.

/Simon




reply via email to

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