From owner-freebsd-questions Sat Jun 26 22:21:21 1999 Delivered-To: freebsd-questions@freebsd.org Received: from obie.softweyr.com (unknown [204.68.178.33]) by hub.freebsd.org (Postfix) with ESMTP id B8BA514A2F; Sat, 26 Jun 1999 22:21:15 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.com (homer.softweyr.com [204.68.178.39]) by obie.softweyr.com (8.8.8/8.8.8) with ESMTP id XAA20608; Sat, 26 Jun 1999 23:21:08 -0600 (MDT) (envelope-from wes@softweyr.com) Message-ID: <3775B4C4.82528C26@softweyr.com> Date: Sat, 26 Jun 1999 23:21:08 -0600 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.5 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Francis Jordan Cc: freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG Subject: Re: building thread-safe Xlibs References: <19990626003458.26580.qmail@ww185.netaddress.usa.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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