Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 1998 20:56:24 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        chaos@oz.org (Simon Coggins)
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Problem with libc_r and blocking.
Message-ID:  <199806052056.NAA03615@usr08.primenet.com>
In-Reply-To: <XFMail.980606002749.chaos@oz.org> from "Simon Coggins" at Jun 6, 98 00:27:49 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I've come across a problem trying to use c_r on freebsd-current. In the
> configure script of Roxen (http://www.roxen.com) web server, if you try and
> make the package use freebsd's libc_r (it takes alittle hacking in configure)
> when it find the threads functions correctly. But when it gets to test
> how to set things non-blocking it freezes and locks up.
> 
> I've attached the .c file of what configure is doing when this happends if you
> compile this with
> 
> gcc -pthread -D_THREAD_SAFE -o tst thread_test.c
> 
> and run it it will lock up if you leave off -pthread it works correctly.
> 
> Anyone out there have any idea? (are there plans to improve the threads
> support in freebsd?) I was looking thru the archives and didn't see much
> in the way of development info.

Worked fine for me...

	hermes% cc -o thread_test thread_test.c
	hermes% ./thread_test
	Testing!!!
	set_nonblocking()
	set_nonblocking()
	hermes%


	hermes% cc -o thread_test -D_THREAD_SAFE thread_test.c -lc_r
	hermes% ./thread_test
	Testing!!!
	set_nonblocking()
	set_nonblocking()
	hermes%

This is on my FreeBSD 2.2-STABLE (post 2.2.5, before the 2.2.6 release)
box.  The _THREAD_SAFE is not necessary on -current, and the -pthread
isn't in my compiler (that I've been able to tell), but all it does
is "-lc_r" before the implied "-lc".. the same thing I did explicitly,
above, with the command I used.


Supposedly, Julian Elisher checked in all of my and Jeremy Allison's
patches to both 2.2.6 and -current.

One of these patches dealt *precisely* with this problem; the ioctl
was not wrapped.  Other changes dealt with fcntl( , F_DUPFD, ), which
was also not wrapped, huge changes to error reporting, and signal
handling and other various changes.

I presume you are running 2.2.5-release or earlier... if so, upgrade.


If you plan on using C++ with threads, use gcc 2.8.x with Jeremy's
patches for per thread exception stacks.  This means you should get
the code from -ports, NOT from FSF!  And *DON'T* use egcs at all.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

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?199806052056.NAA03615>