From 50a6ac7fb90ad4008b354ff8e72c6ce511dbeb3a Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 11 Jan 2005 09:41:40 +0000 Subject: Patch from Paul Mundt (lethal) adding an initial librt implementation. I then reworked the syscall handling and made minor cleanups. With luck I've not completely broken his patch... --- librt/timer_settime.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 librt/timer_settime.c (limited to 'librt/timer_settime.c') diff --git a/librt/timer_settime.c b/librt/timer_settime.c new file mode 100644 index 000000000..1a042283c --- /dev/null +++ b/librt/timer_settime.c @@ -0,0 +1,28 @@ +/* + * timer_settime.c - set the timer. + */ + +#include +#include +#include +#include + +#include "kernel-posix-timers.h" + +#ifdef __NR_timer_settime + +#define __NR___syscall_timer_settime __NR_timer_settime +static inline _syscall4(int, __syscall_timer_settime, kernel_timer_t, ktimerid, + int, flags, const void *, value, void *, ovalue); + +/* Set the expiration time for a timer */ +int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, + struct itimerspec *ovalue) +{ + struct timer *kt = (struct timer *) timerid; + + /* Set timeout */ + return __syscall_timer_settime(kt->ktimerid, flags, value, ovalue); +} + +#endif -- cgit v1.2.3