powerpc-sf longjmp clobbering of val argument
[musl.git] / src / thread / pthread_mutexattr_setrobust.c
blob30a9ac3bea559bb54b762c7df04e0fa035d3ec1e
1 #include "pthread_impl.h"
2 #include "syscall.h"
4 static volatile int check_robust_result = -1;
6 int pthread_mutexattr_setrobust(pthread_mutexattr_t *a, int robust)
8 if (robust > 1U) return EINVAL;
9 if (robust) {
10 int r = check_robust_result;
11 if (r < 0) {
12 void *p;
13 size_t l;
14 r = -__syscall(SYS_get_robust_list, 0, &p, &l);
15 a_store(&check_robust_result, r);
17 if (r) return r;
18 a->__attr |= 4;
19 return 0;
21 a->__attr &= ~4;
22 return 0;