[kaffe] unix-pthreads broken on sunos
robilad at kaffe.org
Mon May 31 10:46:02 PDT 2004
thanks for the bug report.
> Building kaffe with pthreads on solaris (sunos 5.6) fails:
> In file included from ../../../../../kaffe/kaffe/kaffevm/systems/unix-
> At top level:
> 207: warning: no previous prototype for `tDump'
> 249: warning: no previous prototype for `dump_signal_handler'
> In function `tRun':
> 594: error: `PTHREAD_THREADS_MAX' undeclared (first use in this function)
Ouch, it seems like Solaris is not POSIX conforming there. Oh well.
It should be in limits.h, according to the POSIX standard. But judging
by  it seems like solaris does its own thing. Own thing being that
solaris has no limit in theory, but it has one practice. Nevertheless,
it doesn't want to provide the programmer with useful information
regarding such limits, so our best bet is to use
_POSIX_THREAD_THREADS_MAX  for systems that don't define
`PTHREAD_THREADS_MAX'. It's the minimum value, though.
On the other hand, I'm wondering why we have to check for the pthread
max anyway, since my understanding of pthread_create  is that it will
return EAGAIN on failure, so we could simply use that on all systems, no?
I'll write a patch that does that, and give it a spin on linux.
 Keep off the '_', POSIX. Someone on the POSIX standards body should
More information about the kaffe