From owner-freebsd-current Thu Dec 31 11:58:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA11922 for freebsd-current-outgoing; Thu, 31 Dec 1998 11:58:23 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns.tar.com (ns.tar.com [204.95.187.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA11913 for ; Thu, 31 Dec 1998 11:58:20 -0800 (PST) (envelope-from dick@ns.tar.com) Received: (from dick@localhost) by ns.tar.com (8.9.1/8.9.1) id NAA02256; Thu, 31 Dec 1998 13:57:53 -0600 (CST) (envelope-from dick) Date: Thu, 31 Dec 1998 13:57:53 -0600 From: "Richard Seaman, Jr." To: John Deppen Cc: billf@chc-chimes.com, current@FreeBSD.ORG Subject: Re: pthreads or linuxthreads Message-ID: <19981231135753.A1968@tar.com> References: <199812311947.OAA16045@uraninite.srtc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <199812311947.OAA16045@uraninite.srtc.com>; from John Deppen on Thu, Dec 31, 1998 at 02:47:44PM -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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