X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_attr_setstacksize.c;h=09d3fda72ee055ba93de2e1534d153ea2f6754b3;hb=cac872957e8c9e3fc13904c1c55eee0253ec1382;hp=58f4bb180a47e0bc9fb3076d052a875d23e233b2;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/thread/pthread_attr_setstacksize.c b/src/thread/pthread_attr_setstacksize.c index 58f4bb18..09d3fda7 100644 --- a/src/thread/pthread_attr_setstacksize.c +++ b/src/thread/pthread_attr_setstacksize.c @@ -2,7 +2,8 @@ int pthread_attr_setstacksize(pthread_attr_t *a, size_t size) { - if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL; - a->__stacksize = size - DEFAULT_STACK_SIZE; + if (size-PTHREAD_STACK_MIN > SIZE_MAX/4) return EINVAL; + a->_a_stackaddr = 0; + a->_a_stacksize = size - DEFAULT_STACK_SIZE; return 0; }