blob: 2703fa913fb83f2539b32a9b560728df4e13ed38 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * timer_settime.c - set the timer.
3 */
4
5#include <errno.h>
6#include <stdlib.h>
7#include <time.h>
8#include <sys/syscall.h>
9
10#include "kernel-posix-timers.h"
11
12#ifdef __NR_timer_settime
13
14#define __NR___syscall_timer_settime __NR_timer_settime
15static __inline__ _syscall4(int, __syscall_timer_settime, kernel_timer_t, ktimerid,
16 int, flags, const void *, value, void *, ovalue);
17
18/* Set the expiration time for a timer */
19int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
20 struct itimerspec *ovalue)
21{
22 struct timer *kt = (struct timer *)timerid;
23
24 /* Set timeout */
25 return __syscall_timer_settime(kt->ktimerid, flags, value, ovalue);
26}
27
28#endif