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

Unified Diff: sandbox/linux/seccomp-bpf/sandbox_bpf.cc

Issue 11618010: Linux Sandbox: get everything to compile on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/sandbox_linux.gypi ('k') | sandbox/linux/services/android_arm_ucontext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/sandbox_bpf.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index 740320fa326045c29e847a79a9c537970fd2fa8b..b999430ed07d4c3c1c5b700c4fbf522dd7aa590e 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <signal.h>
+#include <sys/syscall.h>
+
#ifndef SECCOMP_BPF_STANDALONE
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
@@ -13,6 +16,11 @@
#include "sandbox/linux/seccomp-bpf/syscall_iterator.h"
#include "sandbox/linux/seccomp-bpf/verifier.h"
+// Android's signal.h doesn't define ucontext etc.
+#if defined(OS_ANDROID) && defined(__arm__)
+#include "sandbox/linux/services/android_arm_ucontext.h"
+#endif
+
namespace {
void WriteFailedStderrSetupMessage(int out_fd) {
@@ -39,7 +47,9 @@ void WriteFailedStderrSetupMessage(int out_fd) {
// realtime signals. There are plenty of them. Unfortunately, there is no
// way to mark a signal as allocated. So, the potential for collision is
// possibly even worse.
-bool GetIsInSigHandler(const ucontext_t *ctx) {
+// Note: we can't use "const ucontext_t" because on Android, sigismember does
+// not take a pointer to const.
+bool GetIsInSigHandler(ucontext_t *ctx) {
Markus (顧孟勤) 2012/12/19 00:44:54 I probably would have left the function signature
jln (very slow on Chromium) 2012/12/19 01:45:32 I was worried that sigismember() might touch the s
return sigismember(&ctx->uc_sigmask, SIGBUS);
}
« no previous file with comments | « sandbox/linux/sandbox_linux.gypi ('k') | sandbox/linux/services/android_arm_ucontext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698