Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Dec 1998 13:57:53 -0600
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        John Deppen <jdeppen@SRTC.COM>
Cc:        billf@chc-chimes.com, current@FreeBSD.ORG
Subject:   Re: pthreads or linuxthreads
Message-ID:  <19981231135753.A1968@tar.com>
In-Reply-To: <199812311947.OAA16045@uraninite.srtc.com>; from John Deppen on Thu, Dec 31, 1998 at 02:47:44PM -0500
References:  <199812311947.OAA16045@uraninite.srtc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 31, 1998 at 02:47:44PM -0500, John Deppen wrote:
> 
> > > Is there any way around the following problem?
> > > 
> > > When the pthreads are linked I get an undefined reference to 'poll'. (Called 
> > > from within a thread)
> > > However, when this is removed I obviously get undefined references to
> > > all of the pthread_.. functions.
> > > 
> > > Thanks in advance for any help,
>  
> > Are you linking the correct libraries as well?
> 
> >From the makefile:
> 
> FLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO #-DAUTHENTICATION -DENCRYPTION
> CFLAGS+=-DENV_HACK
> CFLAGS+=-DSKEY
> CFLAGS+=-I/usr/src/lib -Wall
> #CFLAGS+=-I/usr/src/lib -pthread -Wall ( <- when using thread functions )
> CC=gcc
> 
> The application compiles/links/executes OK when threads are not used.

When you link with -pthread, you are linking in the library libc_r which
brings in the "user thread" pthread library.  AFAIK, the poll call is
not yet implemented in this library.  I don't know if this is being
worked on at present.

> >The linux threads "port" is realistically just a 1-1 kernel pthread
> >implementation.  The idea is that some people might want a kernel
> >thread library, and this is a quick and easy way to get one.
> 
> Is there any effort being made to fix the problems with pthreads? Or is there
> any other way around the problems other than converting the application
> to Linux?

If you link with the linuxthreads pthreads library, you should be able
to get a poll function.  However, its still experimental (the linux threads
port, that is), and its not part of the standard FreeBSD distribution.
If you want to try to play around with it, look at http://lt.tar.com .

-- 
Richard Seamman, 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-current" in the body of the message



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