linuxthreads: Fix up pthread.h for XPG7.
[uclibc-ng.git] / librt / timer_delete.c
blobaf6b34f5d9e11f6cd28f3b1df1087137812d282d
1 /*
2 * timer_delete.c - delete a per-process timer.
3 */
5 #include <errno.h>
6 #include <stdlib.h>
7 #include <time.h>
8 #include <sys/syscall.h>
10 #include "kernel-posix-timers.h"
12 #ifdef __NR_timer_delete
14 #define __NR___syscall_timer_delete __NR_timer_delete
15 static __inline__ _syscall1(int, __syscall_timer_delete, kernel_timer_t, ktimerid);
17 /* Delete a per-process timer */
18 int timer_delete(timer_t timerid)
20 int res;
21 struct timer *kt = (struct timer *)timerid;
23 /* Delete the kernel timer object */
24 res = __syscall_timer_delete(kt->ktimerid);
25 if (res == 0) {
26 free(kt); /* Free the memory */
27 return 0;
30 return -1;
33 #endif