From 7cee6a817bb75d034e8c3fa09fcbf0fe2bd896d5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 11 Mar 2008 21:27:00 +0000 Subject: [PATCH] We only support real time timers. Pretending to support virtual timers only gets the caller into trouble, since then another signal should be sent. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24363 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/sys/itimer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/sys/itimer.c b/src/system/libroot/posix/sys/itimer.c index 14d8c576dd..b2f1d736fd 100644 --- a/src/system/libroot/posix/sys/itimer.c +++ b/src/system/libroot/posix/sys/itimer.c @@ -24,11 +24,18 @@ getitimer(int which, struct itimerval *value) int setitimer(int which, const struct itimerval *value, struct itimerval *oldValue) { - // ToDo: implement me properly! + // TODO: implement me properly! // We probably need a better internal set_alarm() implementation to do this bigtime_t interval = value->it_interval.tv_sec * USEC_PER_SECOND + value->it_interval.tv_usec; bigtime_t remaining; + + // Only real time timers work at all. + if (which != ITIMER_REAL) { + errno = B_NOT_SUPPORTED; + return -1; + } + if (interval != 0) remaining = set_alarm(interval, B_PERIODIC_ALARM); else {