2 #include "pthread_impl.h"
5 #define MIN(a,b) ((a)<(b) ? (a) : (b))
6 #define MAX(a,b) ((a)>(b) ? (a) : (b))
8 int pthread_setattr_default_np(const pthread_attr_t
*attrp
)
10 /* Reject anything in the attr object other than stack/guard size. */
11 pthread_attr_t tmp
= *attrp
, zero
= { 0 };
14 if (memcmp(&tmp
, &zero
, sizeof tmp
))
17 unsigned stack
= MIN(attrp
->_a_stacksize
, DEFAULT_STACK_MAX
);
18 unsigned guard
= MIN(attrp
->_a_guardsize
, DEFAULT_GUARD_MAX
);
21 __default_stacksize
= MAX(__default_stacksize
, stack
);
22 __default_guardsize
= MAX(__default_guardsize
, guard
);
28 int pthread_getattr_default_np(pthread_attr_t
*attrp
)
31 *attrp
= (pthread_attr_t
) {
32 ._a_stacksize
= __default_stacksize
,
33 ._a_guardsize
= __default_guardsize
,