Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 1999 10:42:45 -0500
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        "David O'Brien" <obrien@NUXI.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Linuxthreads "port" status and a request
Message-ID:  <19990408104245.G440@tar.com>
In-Reply-To: <19990407181328.A7059@nuxi.com>; from David O'Brien on Wed, Apr 07, 1999 at 06:13:28PM -0700
References:  <19990407102539.G467@tar.com> <19990407181328.A7059@nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 07, 1999 at 06:13:28PM -0700, David O'Brien wrote:
> > Solution to header problem
> > --------------------------
> > 1) copying the existing pthread.h and pthread_np.h headers to a subdirectory
> > (I've proposed /usr/include/pthread/uthread -- in case the FreeBSD kernel
> > threads also produces a conflict, it could use /usr/include/pthread/kthread).
> 
> Why not just rename pthread.h to linux_pthread.h and pthread_np.h to
> linux_pthread_np.h ?

Could be done.  But, the POSIX pthread spec names pthread.h as the
primary header file.  This would require apps that want to be portable
to have separate non-standard include files for FreeBSD.  It would be
a big PITA for port in the ports tree, as well as for other apps.

With my proposed solution, people would still have to add -DLINUXTHREADS
to the compile options, which would be "non-standard", but thats a lot
easier that editing all the source files to have different headers.
Plus, FreeBSD already makes life difficult because we require the
non-standard -D_THREAD_SAFE compile option (most pthreads implementations
require -D_REENTRANT if they require anything at all).

>  
> > 2) installing a new top level pthread.h that looks like:
> > 
> > #if defined(LINUXTHREADS) || defined(LINUXTHREAD)
> > #include </usr/local/include/pthread/linuxthreads/pthread.h>
> 
> What if PREFIX was set to something other than "/usr/local" when the
> person compiled the port?

Then the user would have to add an additional compile option like:

-I/nonstandard_prefix/include/pthread/linuxthreads

in order for the app to find the right files.  In fact, the main
alternative to what I have proposed is simply to make them
do this anyway using whatever PREFIX they chose, and not mess with
the FreeBSD src tree.

-- 
Richard Seaman, Jr.           email: dick@tar.com
5182 N. Maple Lane            phone: 414-367-5450
Chenequa WI 53058             fax:   414-367-5852


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990408104245.G440>