summaryrefslogtreecommitdiffstats
path: root/libc/bionic/sysconf.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-02-11 12:34:03 -0800
committerElliott Hughes <enh@google.com>2013-02-11 14:56:39 -0800
commit2a1bb4e64677b9abbc17173c79768ed494565047 (patch)
tree3e843fd4277f2bdc502511bd5e4ee539887c14f1 /libc/bionic/sysconf.cpp
parent2d3e72336e76180fb00822386da4f14203d117ce (diff)
downloadbionic-2a1bb4e64677b9abbc17173c79768ed494565047.zip
bionic-2a1bb4e64677b9abbc17173c79768ed494565047.tar.gz
bionic-2a1bb4e64677b9abbc17173c79768ed494565047.tar.bz2
More pthreads cleanup.
POSIX says pthread_create returns EAGAIN, not ENOMEM. Also pull pthread_attr_t functions into their own file. Also pull pthread_setname_np into its own file. Also remove unnecessary #includes from pthread_key.cpp. Also account for those pthread keys used internally by bionic, so they don't count against the number of keys available to user code. (They do with glibc, but glibc's limit is the much more generous 1024.) Also factor out the common errno-restoring idiom to reduce gotos. Bug: 6702535 Change-Id: I555e66efffcf2c1b5a2873569e91489156efca42
Diffstat (limited to 'libc/bionic/sysconf.cpp')
-rw-r--r--libc/bionic/sysconf.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/bionic/sysconf.cpp b/libc/bionic/sysconf.cpp
index f4845e1..869faef 100644
--- a/libc/bionic/sysconf.cpp
+++ b/libc/bionic/sysconf.cpp
@@ -306,7 +306,7 @@ int sysconf(int name) {
return _POSIX_THREAD_DESTRUCTOR_ITERATIONS;
case _SC_THREAD_KEYS_MAX:
- return (BIONIC_TLS_SLOTS - TLS_SLOT_FIRST_USER_SLOT);
+ return (BIONIC_TLS_SLOTS - TLS_SLOT_FIRST_USER_SLOT - GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT);
case _SC_THREAD_STACK_MIN: return SYSTEM_THREAD_STACK_MIN;
case _SC_THREAD_THREADS_MAX: return SYSTEM_THREAD_THREADS_MAX;