[uClibc]pthreads patches

Erik Andersen andersen at codepoet.org
Tue Oct 22 07:34:22 UTC 2002


On Tue Oct 22, 2002 at 08:20:02AM +0200, Arne Jonsson wrote:
> Hello!
> 
> We are using pthreads quite heavily and have experienced some races and
> have therefore made some changes to the code in order for our
> application to work correctly.
> I'm a little curious why nobody else have experienced problems, we
> surely can't be the only one using pthreads and uClinux 2.0.38?

I dunno.  You may very well be the first.  Or the first to make
it work anyways.  Perhaps others tried and failed, but never
submitted a bug report...  Regardless, it'll be good to get
threads working with uClinux 2.0.x kernels also, since the kernel
seems to be getting bigger with each release.

> In the patches below is also some code changing the system call poll to
> select as the poll call isn't supported in 2.0 kernel.
> 
> Would it be possible to introduce some means to indicate which kernel
> version the uClibc is to be used against, I believe this is necessary as
> the kernels seems to disagree on the system calls supported (and other
> stuff)? 

The easiest way is to include sys/syscall.h, and then check at
compile time if "__NR_poll" is defined.  This works, since uClibc
does not even try to support multiple kernel versions with a
single binary -- just the kernel version that uClibc was built
against.

> The patches are made against manager.c and pthread.c in 0.9.15 but the
> latest version in CVS seems to be the same as in 0.9.15.

Yup, for the most part that stuff hasn't changed at all.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list