1 #include "pthread_impl.h"
3 int pthread_setcancelstate(int new, int *old)
5 if (new > 1U) return EINVAL;
6 if (!libc.has_thread_pointer) return ENOSYS;
7 struct pthread *self = __pthread_self();
8 if (old) *old = self->canceldisable;
9 self->canceldisable = new;