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