don't assume posix compatibility means posix clocks
authorcraigdo@craig-dowells-imac.local
Thu, 28 Aug 2008 15:06:49 -0700
changeset 3564 92ef80f0352e
parent 3563 775d9648a294
child 3565 e0a429cb5811
child 3568 01bebf28addd
don't assume posix compatibility means posix clocks
src/simulator/wall-clock-synchronizer.cc
--- a/src/simulator/wall-clock-synchronizer.cc	Wed Aug 27 11:39:31 2008 -0700
+++ b/src/simulator/wall-clock-synchronizer.cc	Thu Aug 28 15:06:49 2008 -0700
@@ -56,11 +56,17 @@
 // requires a delay less than a jiffy.  This is on the order of one millisecond
 // (999848 ns) on the ns-regression machine.
 // 
+// If the underlying OS does not support posix clocks, we'll just assume a 
+// one millisecond quantum and deal with this as best we can
+
+#ifdef CLOCK_REALTIME
   struct timespec ts;
   clock_getres (CLOCK_REALTIME, &ts);
   m_jiffy = ts.tv_sec * NS_PER_SEC + ts.tv_nsec;
   NS_LOG_INFO ("Jiffy is " << m_jiffy << " ns");
-
+#else
+  m_jiffy = 1000000;
+#endif
 #if 0
 //
 // DANGER DANGER WILL ROBINSON