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

Re: Request official mandate for -D_REENTRANT



> > Does -D_REENTRANT effect header files? ie. should libdb be built with
> > that flag even though it doesn't have any code of it's own that
> > recognizes it?
> 
> Yes!  Even if a library doesn't support threads itself, it still needs
> to be compiled with -D_REENTRANT so that it picks up the threaded
> portions of libc.  For example, errno is handled differently depending
> on whether or not -D_REENTRANT is used.  When -D_REENTRANT is not
> used, errno is simply a global integer.  When -D_REENTRANT is used,
> errno is a macro which evaluates to the lvalue of a per-thread
> integer.  So if libdb uses errno (pretty likely) and isn't compiled
> with -D_REENTRANT, it can't safely be used by a threaded application.

Would it be worth making this a standard define within gcc?
                                             
                                          Brian
                                 ( bcwhite@verisim.com )
                                             
-------------------------------------------------------------------------------
 the difference between theory and practice is less in theory than in practice


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: