summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2015-01-08 12:32:42 -0800
committerYabin Cui <yabinc@google.com>2015-01-08 14:27:24 -0800
commit917d390510e442b9b030d54992ebf41cc1e7f853 (patch)
treefd11b414b2b5f550c20944d916b07533d125b061 /libc/bionic
parentb5e508cfee2355bad0502587e4fce8f4173584d6 (diff)
downloadbionic-917d390510e442b9b030d54992ebf41cc1e7f853.zip
bionic-917d390510e442b9b030d54992ebf41cc1e7f853.tar.gz
bionic-917d390510e442b9b030d54992ebf41cc1e7f853.tar.bz2
Make pthread stack size match real range.
Bug: 18908062 Change-Id: I7037ac8273ebe54dd19b1561c7a376819049124c
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/pthread_create.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index 7e74dac..e4abee9 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -158,6 +158,7 @@ static int __allocate_thread(pthread_attr_t* attr, pthread_internal_t** threadp,
// thread stack (including guard page)
stack_top -= sizeof(pthread_internal_t);
pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(stack_top);
+ attr->stack_size = stack_top - reinterpret_cast<uint8_t*>(attr->stack_base);
// No need to check stack_top alignment. The size of pthread_internal_t is 16-bytes aligned,
// and user allocated stack is guaranteed by pthread_attr_setstack.