1 #include "pthread_impl.h"
3 int pthread_attr_getdetachstate(const pthread_attr_t
*a
, int *state
)
8 int pthread_attr_getguardsize(const pthread_attr_t
*restrict a
, size_t *restrict size
)
10 *size
= a
->_a_guardsize
;
14 int pthread_attr_getinheritsched(const pthread_attr_t
*restrict a
, int *restrict inherit
)
16 *inherit
= a
->_a_sched
;
20 int pthread_attr_getschedparam(const pthread_attr_t
*restrict a
, struct sched_param
*restrict param
)
22 param
->sched_priority
= a
->_a_prio
;
26 int pthread_attr_getschedpolicy(const pthread_attr_t
*restrict a
, int *restrict policy
)
28 *policy
= a
->_a_policy
;
32 int pthread_attr_getscope(const pthread_attr_t
*restrict a
, int *restrict scope
)
34 *scope
= PTHREAD_SCOPE_SYSTEM
;
38 int pthread_attr_getstack(const pthread_attr_t
*restrict a
, void **restrict addr
, size_t *restrict size
)
42 *size
= a
->_a_stacksize
;
43 *addr
= (void *)(a
->_a_stackaddr
- *size
);
47 int pthread_attr_getstacksize(const pthread_attr_t
*restrict a
, size_t *restrict size
)
49 *size
= a
->_a_stacksize
;
53 int pthread_barrierattr_getpshared(const pthread_barrierattr_t
*restrict a
, int *restrict pshared
)
55 *pshared
= !!a
->__attr
;
59 int pthread_condattr_getclock(const pthread_condattr_t
*restrict a
, clockid_t
*restrict clk
)
61 *clk
= a
->__attr
& 0x7fffffff;
65 int pthread_condattr_getpshared(const pthread_condattr_t
*restrict a
, int *restrict pshared
)
67 *pshared
= a
->__attr
>>31;
71 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t
*restrict a
, int *restrict protocol
)
73 *protocol
= a
->__attr
/ 8U % 2;
76 int pthread_mutexattr_getpshared(const pthread_mutexattr_t
*restrict a
, int *restrict pshared
)
78 *pshared
= a
->__attr
/ 128U % 2;
82 int pthread_mutexattr_getrobust(const pthread_mutexattr_t
*restrict a
, int *restrict robust
)
84 *robust
= a
->__attr
/ 4U % 2;
88 int pthread_mutexattr_gettype(const pthread_mutexattr_t
*restrict a
, int *restrict type
)
90 *type
= a
->__attr
& 3;
94 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t
*restrict a
, int *restrict pshared
)
96 *pshared
= a
->__attr
[0];