Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jun 1999 23:21:08 -0600
From:      Wes Peters <wes@softweyr.com>
To:        Francis Jordan <frankrj@netscape.net>
Cc:        freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG
Subject:   Re: building thread-safe Xlibs
Message-ID:  <3775B4C4.82528C26@softweyr.com>
References:  <19990626003458.26580.qmail@ww185.netaddress.usa.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Francis Jordan wrote:
> 
> Can anyone please give me some clues as to how to build X with thread support
> enabled.  I think the right way to do it is to add the relevant options to
> config/cf/FreeBSD.cf, something like
> 
> #define HasPosixThreads         YES
> #define ThreadedX               YES
> #define ThreadsLibraries        -pthread  /* (or should it be -lc_r ? */
> #define SystemMTDefines         -D_REENTRANT  /*  required ???  */
> #define HasThreadSafeAPI        NO
>                                 ^^
> ---------------------------------
> 
> Here's the thing - FreeBSD doesn't seem to have thread-safe interfaces for
> functions like getpwnam, getpwuid, getpwent (Solaris has getpwnam_r,
> getpwuid_r, getpwent_r), hence lots of unresolved references.  Then there's
> the file
> 
>      xc/include/Xos_r.h
> 
> which contains definitions of same (basically, pwd.h wrappers) for various
> platforms, but not FreeBSD (I guess at the time FreeBSD didn't have threads).
> Unfortunately, the wrappers for other platforms are no good, as FreeBSD's pwd
> structures are different from everything else.
> 
> If anyone has gotten the darn thing to compile, could you please send me the
> relevant patches?  Alternatively, is anyone looking into implementing the _r
> API for getpwent?

Yes, but I've been putting the getpwent_r routines off until last
because they are going to be nasty.  Locking access to a dbm database
doesn't look good, so we may have to change to the newlib version of 
dbm in order to support them.  This probably wouldn't happen until 
4.0, and I'd have to come up with a binary file coverter, unless the
newlib version already does that.

Ick!  ;^)

-- 
       "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                 Softweyr LLC
http://www.softweyr.com/~softweyr                      wes@softweyr.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3775B4C4.82528C26>