diff options
author | William Pitcock <nenolod@dereferenced.org> | 2018-02-02 20:08:55 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-02-03 10:04:24 -0500 |
commit | 7c709f2d4f9872d1b445f760b0e68da89e256b9e (patch) | |
tree | 6676308cc593374bc1ee601456665848ddde74eb /src/thread | |
parent | b3ae7beabb9f0c219bb8a8b63567a01c6530c1ac (diff) | |
download | musl-7c709f2d4f9872d1b445f760b0e68da89e256b9e.tar.gz musl-7c709f2d4f9872d1b445f760b0e68da89e256b9e.tar.bz2 musl-7c709f2d4f9872d1b445f760b0e68da89e256b9e.tar.xz musl-7c709f2d4f9872d1b445f760b0e68da89e256b9e.zip |
store pthread stack guard sizes for pthread_getattr_np
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/pthread_create.c | 3 | ||||
-rw-r--r-- | src/thread/pthread_getattr_np.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 34cd9936..439ee363 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -232,8 +232,8 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att memset(stack, 0, need); } else { size = ROUND(need); - guard = 0; } + guard = 0; } else { guard = ROUND(attr._a_guardsize); size = guard + ROUND(attr._a_stacksize @@ -265,6 +265,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att new->map_size = size; new->stack = stack; new->stack_size = stack - stack_limit; + new->guard_size = guard; new->start = entry; new->start_arg = arg; new->self = new; diff --git a/src/thread/pthread_getattr_np.c b/src/thread/pthread_getattr_np.c index ae26a5ab..29a209bd 100644 --- a/src/thread/pthread_getattr_np.c +++ b/src/thread/pthread_getattr_np.c @@ -7,6 +7,7 @@ int pthread_getattr_np(pthread_t t, pthread_attr_t *a) { *a = (pthread_attr_t){0}; a->_a_detach = !!t->detached; + a->_a_guardsize = t->guard_size; if (t->stack) { a->_a_stackaddr = (uintptr_t)t->stack; a->_a_stacksize = t->stack_size; |