Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc

Issue 1133653002: Allow coarse clocks in clock_get{res,time} calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow coarse clocks in clock_get{res,time} calls, v2 Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux/net.h> 10 #include <linux/net.h>
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 ResultExpr RestrictClockID() { 301 ResultExpr RestrictClockID() {
302 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit"); 302 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit");
303 const Arg<clockid_t> clockid(0); 303 const Arg<clockid_t> clockid(0);
304 return If( 304 return If(
305 #if defined(OS_CHROMEOS) 305 #if defined(OS_CHROMEOS)
306 // Allow the special clock for Chrome OS used by Chrome tracing. 306 // Allow the special clock for Chrome OS used by Chrome tracing.
307 clockid == base::TimeTicks::kClockSystemTrace || 307 clockid == base::TimeTicks::kClockSystemTrace ||
308 #endif 308 #endif
309 clockid == CLOCK_MONOTONIC || 309 clockid == CLOCK_MONOTONIC ||
310 clockid == CLOCK_MONOTONIC_COARSE ||
310 clockid == CLOCK_PROCESS_CPUTIME_ID || 311 clockid == CLOCK_PROCESS_CPUTIME_ID ||
311 clockid == CLOCK_REALTIME || 312 clockid == CLOCK_REALTIME ||
313 clockid == CLOCK_REALTIME_COARSE ||
312 clockid == CLOCK_THREAD_CPUTIME_ID, 314 clockid == CLOCK_THREAD_CPUTIME_ID,
313 Allow()).Else(CrashSIGSYS()); 315 Allow()).Else(CrashSIGSYS());
314 } 316 }
315 317
316 } // namespace sandbox. 318 } // namespace sandbox.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698