Re: PTHREAD_THREADS_MAX missing?

Ulrich Drepper <[email protected]>
Newsgroups gmane.comp.lib.phil
Organization Red Hat, Inc.
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Kegel wrote:
> Jakub Jelinek wrote:
> 
>>>>> The ltp-20030324 version compile of trace_sched.c fails because

> Uh-oh, looks like it might be -1; see
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/posix/sysconf.c?rev=1.32
> 
> 
>     case _SC_THREAD_THREADS_MAX:
> #ifdef  PTHREAD_THREADS_MAX
>       return PTHREAD_THREADS_MAX;
> #else
>       return -1;
> #endif
> 
> Is that compliant?
> 
> Maybe sysconf could call a "get max threads" function from the thread
> addon here.

That's not necessary.  -1 is a perfectly valid answer which a quick look
at the sysconf definition would have shown you:

  If the variable corresponding to name has no limit, sysconf() shall
  return 1 without changing the value of errno.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+i1NH2ijCOnn/RHQRAlibAJ9NhhFc3AFctmhagEurjHDo3PwLLgCfRy/O
RqsbQXbTQoh68oJ8hw/EFtA=
=H+TG
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.