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