Bug 1264226: Don't use '_COARSE' Posix clocks if not defined, r=jld
authorThomas Zimmermann <tdz@users.sourceforge.net>
Thu, 14 Apr 2016 10:12:39 +0200
changeset 331115 66c438e0cb1f0c3aefe1bedd1862eb206b766920
parent 331114 18ba8acba7902115a6f897d7d22b1cc33cb56008
child 331116 7176863d8df7554359e3fce9be36e883b102dd12
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1264226
milestone48.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 1264226: Don't use '_COARSE' Posix clocks if not defined, r=jld Not all systems (i.e., Gonk) support CLOCK_MONOTONIC_COARSE and CLOCK_REALTIME_COARSE. With this patch, we don't refer to them if they are not supported.
security/sandbox/linux/SandboxFilter.cpp
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -140,20 +140,24 @@ public:
   }
 
   virtual ResultExpr EvaluateSyscall(int sysno) const override {
     switch (sysno) {
       // Timekeeping
     case __NR_clock_gettime: {
       Arg<clockid_t> clk_id(0);
       return If(clk_id == CLOCK_MONOTONIC, Allow())
+#ifdef CLOCK_MONOTONIC_COARSE
         .ElseIf(clk_id == CLOCK_MONOTONIC_COARSE, Allow())
+#endif
         .ElseIf(clk_id == CLOCK_PROCESS_CPUTIME_ID, Allow())
         .ElseIf(clk_id == CLOCK_REALTIME, Allow())
+#ifdef CLOCK_REALTIME_COARSE
         .ElseIf(clk_id == CLOCK_REALTIME_COARSE, Allow())
+#endif
         .ElseIf(clk_id == CLOCK_THREAD_CPUTIME_ID, Allow())
         .Else(InvalidSyscall());
     }
     case __NR_gettimeofday:
 #ifdef __NR_time
     case __NR_time:
 #endif
     case __NR_nanosleep: