Bug 648735 - On OpenBSD, assume clock is monotonic; r=cjones
authorLandry Breuil <landry@openbsd.org>
Tue, 20 Sep 2011 13:23:04 +0100
changeset 77196 7039bba56b10cda3fd921d33015d79cf74128a11
parent 77195 226136c5812e8a42c1c3ad1a20de7014445f14a3
child 77197 4792fc2600869a844e28c56e46667e8a20fcebce
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerscjones
bugs648735
milestone9.0a1
Bug 648735 - On OpenBSD, assume clock is monotonic; r=cjones otherwise fails with: ipc/chromium/src/base/time_posix.cc:181:2: error: #error No usable tick clock function on this platform.
ipc/chromium/src/base/time_posix.cc
--- a/ipc/chromium/src/base/time_posix.cc
+++ b/ipc/chromium/src/base/time_posix.cc
@@ -159,17 +159,17 @@ TimeTicks TimeTicks::Now() {
   // to microseconds up front to stave off overflows.
   absolute_micro = mach_absolute_time() / Time::kNanosecondsPerMicrosecond *
                    timebase_info.numer / timebase_info.denom;
 
   // Don't bother with the rollover handling that the Windows version does.
   // With numer and denom = 1 (the expected case), the 64-bit absolute time
   // reported in nanoseconds is enough to last nearly 585 years.
 
-#elif defined(OS_POSIX) && \
+#elif defined(__OpenBSD__) || defined(OS_POSIX) && \
       defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
 
   struct timespec ts;
   if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
     NOTREACHED() << "clock_gettime(CLOCK_MONOTONIC) failed.";
     return TimeTicks();
   }