summaryrefslogtreecommitdiff
path: root/src/thread/pthread_setcancelstate.c
blob: aa0ddcdd316341ec0ab7a685e2e84a5a8a2b149b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include "pthread_impl.h"

int pthread_setcancelstate(int new, int *old)
{
	struct pthread *self = pthread_self();
	if (old) *old = self->canceldisable;
	if (new > 1U) return EINVAL;
	self->canceldisable = new;
	return 0;
}