mirror of
https://github.com/fluencelabs/musl
synced 2025-07-02 16:12:02 +00:00
previously, the pthread_attr_t object was always initialized all-zero, and stack/guard size were represented as differences versus their defaults. this required lots of confusing offset arithmetic everywhere they were used. instead, have pthread_attr_init fill in the default values, and work with absolute sizes everywhere.
9 lines
168 B
C
9 lines
168 B
C
#include "pthread_impl.h"
|
|
|
|
int pthread_attr_setguardsize(pthread_attr_t *a, size_t size)
|
|
{
|
|
if (size > SIZE_MAX/8) return EINVAL;
|
|
a->_a_guardsize = size;
|
|
return 0;
|
|
}
|