Bug 648735 - On OpenBSD, assume clock is monotonic; r=cjones
authorLandry Breuil <landry@openbsd.org>
Tue, 20 Sep 2011 13:23:04 +0100
changeset 78507 7039bba56b10cda3fd921d33015d79cf74128a11
parent 78506 226136c5812e8a42c1c3ad1a20de7014445f14a3
child 78508 4792fc2600869a844e28c56e46667e8a20fcebce
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs648735
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();
   }