fix bogus lazy allocation in ctermid and missing malloc failure check
[musl] / src / thread / pthread_attr_get.c
index f81103d..ad913c5 100644 (file)
@@ -11,7 +11,7 @@ int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict
        return 0;
 }
 
-int pthread_attr_getinheritsched(const pthread_attr_t *a, int *inherit)
+int pthread_attr_getinheritsched(const pthread_attr_t *restrict a, int *restrict inherit)
 {
        *inherit = a->_a_sched;
        return 0;
@@ -23,7 +23,7 @@ int pthread_attr_getschedparam(const pthread_attr_t *restrict a, struct sched_pa
        return 0;
 }
 
-int pthread_attr_getschedpolicy(const pthread_attr_t *a, int *policy)
+int pthread_attr_getschedpolicy(const pthread_attr_t *restrict a, int *restrict policy)
 {
        *policy = a->_a_policy;
        return 0;
@@ -68,6 +68,11 @@ int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restr
        return 0;
 }
 
+int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol)
+{
+       *protocol = PTHREAD_PRIO_NONE;
+       return 0;
+}
 int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared)
 {
        *pshared = *a>>31;