From e501656b4aebb21df9335572b9a241fb676db438 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 28 Jan 2007 14:14:40 +0000 Subject: [PATCH] (lwpProc): Change type of member runtime to time_t. (lwpSleepUntil): Change type of parameter to time_t. --- include/lwp.h | 3 ++- src/lib/lwp/lwpint.h | 2 +- src/lib/lwp/sel.c | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/lwp.h b/include/lwp.h index 6fccd584..00feba7c 100644 --- a/include/lwp.h +++ b/include/lwp.h @@ -25,6 +25,7 @@ #define LWP_H #include +#include #define LWP_STACKCHECK 0x1 #define LWP_PRINT 0x2 @@ -46,7 +47,7 @@ void lwpExit(void); void lwpTerminate(struct lwpProc * p); void lwpYield(void); void lwpSleepFd(int fd, int flags); -void lwpSleepUntil(long until); +void lwpSleepUntil(time_t until); void lwpWakeupFd(struct lwpProc * p); int lwpSigWait(sigset_t *set, int *sig); void *lwpGetUD(struct lwpProc * p); diff --git a/src/lib/lwp/lwpint.h b/src/lib/lwp/lwpint.h index 5fd25350..c0ba9997 100644 --- a/src/lib/lwp/lwpint.h +++ b/src/lib/lwp/lwpint.h @@ -58,7 +58,7 @@ struct lwpProc { void (*entry)(void *); /* entry point */ int dead; /* whether the process can be rescheduled */ int pri; /* which scheduling queue we're on */ - long runtime; /* time at which process is restarted */ + time_t runtime; /* time at which process is restarted */ int fd; /* fd we're blocking on */ int argc; /* initial arguments */ char **argv; diff --git a/src/lib/lwp/sel.c b/src/lib/lwp/sel.c index 1d1b12ad..77dea038 100644 --- a/src/lib/lwp/sel.c +++ b/src/lib/lwp/sel.c @@ -123,9 +123,10 @@ lwpWakeupFd(struct lwpProc *proc) } void -lwpSleepUntil(long until) +lwpSleepUntil(time_t until) { - lwpStatus(LwpCurrent, "sleeping for %ld sec", until - time(0)); + lwpStatus(LwpCurrent, "sleeping for %ld sec", + (long)(until - time(NULL))); LwpCurrent->runtime = until; if (LwpMaxfd == 0 && LwpDelayq.head == 0) { /* select process is sleeping until first waiter arrives */