bug-gnulib
[Top][All Lists]
Advanced

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

Re: lock module question


From: Yoann Vandoorselaere
Subject: Re: lock module question
Date: Wed, 05 Mar 2008 17:06:05 +0100

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


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? 

-- 
Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies
Tel: +33 (0)8 70 70 21 58                  Fax: +33(0)4 78 42 21 58
http://www.prelude-ids.com





reply via email to

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