Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way.

Also make sysconf use PTHREAD_STACK_MIN rather than redefining its
own, different, constant.

Bug: 9997352
Change-Id: I9a8e7d2b18e691439abfb45533e82c36eee9e81d
This commit is contained in:
Elliott Hughes
2013-07-29 16:51:45 -07:00
parent 9a73d08f4c
commit c03e1e7439
3 changed files with 10 additions and 5 deletions

View File

@@ -76,7 +76,12 @@ enum {
* maintain that second number, but pthread_test will fail if we forget.
*/
#define GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT 4
#define BIONIC_TLS_SLOTS 128
/*
* This is PTHREAD_KEYS_MAX + TLS_SLOT_FIRST_USER_SLOT + GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT
* rounded up to maintain stack alignment.
*/
#define BIONIC_ALIGN(x, a) (((x) + (a - 1)) & ~(a - 1))
#define BIONIC_TLS_SLOTS BIONIC_ALIGN(128 + TLS_SLOT_FIRST_USER_SLOT + GLOBAL_INIT_THREAD_LOCAL_BUFFER_COUNT, 4)
/* syscall only, do not call directly */
extern int __set_tls(void* ptr);