summaryrefslogtreecommitdiff
path: root/pfinet/mapped-time.h
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-08-09 16:54:09 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-08-09 16:54:09 +0000
commit614941a4cfa3a6d07d7f93bedca1a2ada776e5a8 (patch)
tree67a82d72e5d235f00fc010c50a875e8751a4c483 /pfinet/mapped-time.h
parentcfe5ef951dd1fe7b7a22e594145ca780df146f4c (diff)
Formerly mapped-time.h.~2~
Diffstat (limited to 'pfinet/mapped-time.h')
-rw-r--r--pfinet/mapped-time.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/pfinet/mapped-time.h b/pfinet/mapped-time.h
index d0fccee8..ec4aaddc 100644
--- a/pfinet/mapped-time.h
+++ b/pfinet/mapped-time.h
@@ -4,6 +4,7 @@
#define HZ 100
extern volatile struct mapped_time_value *mapped_time;
+extern long long root_jiffies;
extern inline int
read_mapped_secs ()
@@ -16,16 +17,17 @@ fill_timeval (struct timeval *tp)
{
do
{
- tp->tv_secs = mapped_time->seconds;
- tp->tv_usecs = mapped_time->microseconds;
+ tp->tv_sec = mapped_time->seconds;
+ tp->tv_usec = mapped_time->microseconds;
}
- while (tp->tv_secs != mapped_time->check_seconds);
+ while (tp->tv_sec != mapped_time->check_seconds);
}
extern inline int
fetch_jiffies ()
{
int secs, usecs;
+ long long j;
do
{
secs = mapped_time->seconds;
@@ -33,7 +35,8 @@ fetch_jiffies ()
}
while (secs != mapped_time->check_seconds);
- return (secs * HZ) + microseconds * HZ / 1000.0;
+ j = (long long) secs * HZ + (long long) usecs * HZ / 1000.0;
+ return j - root_jiffies;
}