diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp index 125b3c92f..cff62885c 100644 --- a/libc/bionic/sysconf.cpp +++ b/libc/bionic/sysconf.cpp @@ -124,8 +124,8 @@ long sysconf(int name) { case _SC_THREAD_DESTRUCTOR_ITERATIONS: return PTHREAD_DESTRUCTOR_ITERATIONS; case _SC_THREAD_KEYS_MAX: return PTHREAD_KEYS_MAX; case _SC_THREAD_STACK_MIN: return PTHREAD_STACK_MIN; - case _SC_THREAD_THREADS_MAX: return PTHREAD_THREADS_MAX; - case _SC_TTY_NAME_MAX: return 32; // Seems default on linux. + case _SC_THREAD_THREADS_MAX: return -1; // No specific limit. + case _SC_TTY_NAME_MAX: return 32; // Seems default on linux. case _SC_THREADS: return _POSIX_THREADS; case _SC_THREAD_ATTR_STACKADDR: return _POSIX_THREAD_ATTR_STACKADDR; case _SC_THREAD_ATTR_STACKSIZE: return _POSIX_THREAD_ATTR_STACKSIZE; diff --git a/libc/include/sys/limits.h b/libc/include/sys/limits.h index be79cf3f3..f84253e6b 100644 --- a/libc/include/sys/limits.h +++ b/libc/include/sys/limits.h @@ -120,8 +120,11 @@ #define _XOPEN_VERSION 700 /* by Posix definition */ -#define PTHREAD_DESTRUCTOR_ITERATIONS 4 // >= _POSIX_THREAD_DESTRUCTOR_ITERATIONS -#define PTHREAD_KEYS_MAX 128 // >= _POSIX_THREAD_KEYS_MAX -#define PTHREAD_THREADS_MAX 2048 // bionic has no specific limit +/* >= _POSIX_THREAD_DESTRUCTOR_ITERATIONS */ +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 +/* >= _POSIX_THREAD_KEYS_MAX */ +#define PTHREAD_KEYS_MAX 128 +/* bionic has no specific limit */ +#undef PTHREAD_THREADS_MAX #endif