summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-11-08 11:51:57 -0500
committerRich Felker <dalias@aerifal.cx>2016-11-08 11:51:57 -0500
commitea7891a651dc4abc1305438470f1e4cc3b64ece2 (patch)
tree60144f10f321da134d16b0f6a3f7d39859e845c5 /src/thread
parent04983f2272382af92eb8f8838964ff944fbb8258 (diff)
downloadmusl-ea7891a651dc4abc1305438470f1e4cc3b64ece2.tar.gz
fix pthread_create regression from stack/guard size simplification
commit 33ce920857405d4f4b342c85b74588a15e2702e5 broke pthread_create in the case where a null attribute pointer is passed; rather than using the default sizes, sizes of 0 (plus the remainder of one page after TLS/TCB use) were used.
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/pthread_create.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index db9e575e..e8d4a635 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -186,7 +186,10 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
| CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS
| CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | CLONE_DETACHED;
int do_sched = 0;
- pthread_attr_t attr = {0};
+ pthread_attr_t attr = {
+ ._a_stacksize = DEFAULT_STACK_SIZE,
+ ._a_guardsize = DEFAULT_GUARD_SIZE,
+ };
if (!libc.can_do_threads) return ENOSYS;
self = __pthread_self();