xref: /aosp_15_r20/external/musl/src/thread/pthread_setcancelstate.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1 #include "pthread_impl.h"
2 
__pthread_setcancelstate(int new,int * old)3 int __pthread_setcancelstate(int new, int *old)
4 {
5 	if (new > 2U) return EINVAL;
6 	struct pthread *self = __pthread_self();
7 	if (old) *old = self->canceldisable;
8 	self->canceldisable = new;
9 	return 0;
10 }
11 
12 weak_alias(__pthread_setcancelstate, pthread_setcancelstate);
13