summaryrefslogtreecommitdiff
path: root/src/time/timer_delete.c
blob: 437de2e06a32926cdb71ef3709f420f23eb83146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <time.h>
#include "pthread_impl.h"

int timer_delete(timer_t t)
{
	pthread_t td = 0;
	int r;
	if ((uintptr_t)t & 1) t = (void *)((unsigned long)t / 2);
	else td = t, t = td->result;
	r = __syscall(SYS_timer_delete, (long)t);
	if (td) pthread_cancel(td);
	return r;
}