use libc-internal malloc for newlocale/freelocale
[musl] / src / thread / pthread_attr_get.c
index 03fc91e..f12ff44 100644 (file)
@@ -7,7 +7,7 @@ int pthread_attr_getdetachstate(const pthread_attr_t *a, int *state)
 }
 int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size)
 {
-       *size = a->_a_guardsize + DEFAULT_GUARD_SIZE;
+       *size = a->_a_guardsize;
        return 0;
 }
 
@@ -39,14 +39,14 @@ int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr
 {
        if (!a->_a_stackaddr)
                return EINVAL;
-       *size = a->_a_stacksize + DEFAULT_STACK_SIZE;
+       *size = a->_a_stacksize;
        *addr = (void *)(a->_a_stackaddr - *size);
        return 0;
 }
 
 int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size)
 {
-       *size = a->_a_stacksize + DEFAULT_STACK_SIZE;
+       *size = a->_a_stacksize;
        return 0;
 }
 
@@ -70,12 +70,12 @@ int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restr
 
 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol)
 {
-       *protocol = PTHREAD_PRIO_NONE;
+       *protocol = a->__attr / 8U % 2;
        return 0;
 }
 int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared)
 {
-       *pshared = a->__attr>>31;
+       *pshared = a->__attr / 128U % 2;
        return 0;
 }