OLD | NEW |
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 // Note: any code in this file MUST be async-signal safe. | 5 // Note: any code in this file MUST be async-signal safe. |
6 | 6 |
7 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 7 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
8 | 8 |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/posix/eintr_wrapper.h" | 12 #include "base/posix/eintr_wrapper.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 14 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
15 | 15 |
| 16 #if defined(__mips__) |
| 17 // __NR_Linux, is defined in <asm/unistd.h>. |
| 18 #include <asm/unistd.h> |
| 19 #endif |
| 20 |
16 #define SECCOMP_MESSAGE_COMMON_CONTENT "seccomp-bpf failure" | 21 #define SECCOMP_MESSAGE_COMMON_CONTENT "seccomp-bpf failure" |
17 #define SECCOMP_MESSAGE_CLONE_CONTENT "clone() failure" | 22 #define SECCOMP_MESSAGE_CLONE_CONTENT "clone() failure" |
18 #define SECCOMP_MESSAGE_PRCTL_CONTENT "prctl() failure" | 23 #define SECCOMP_MESSAGE_PRCTL_CONTENT "prctl() failure" |
19 #define SECCOMP_MESSAGE_IOCTL_CONTENT "ioctl() failure" | 24 #define SECCOMP_MESSAGE_IOCTL_CONTENT "ioctl() failure" |
20 #define SECCOMP_MESSAGE_KILL_CONTENT "(tg)kill() failure" | 25 #define SECCOMP_MESSAGE_KILL_CONTENT "(tg)kill() failure" |
21 #define SECCOMP_MESSAGE_FUTEX_CONTENT "futex() failure" | 26 #define SECCOMP_MESSAGE_FUTEX_CONTENT "futex() failure" |
22 | 27 |
23 namespace { | 28 namespace { |
24 | 29 |
25 inline bool IsArchitectureX86_64() { | 30 inline bool IsArchitectureX86_64() { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 248 |
244 const char* GetKillErrorMessageContentForTests() { | 249 const char* GetKillErrorMessageContentForTests() { |
245 return SECCOMP_MESSAGE_KILL_CONTENT; | 250 return SECCOMP_MESSAGE_KILL_CONTENT; |
246 } | 251 } |
247 | 252 |
248 const char* GetFutexErrorMessageContentForTests() { | 253 const char* GetFutexErrorMessageContentForTests() { |
249 return SECCOMP_MESSAGE_FUTEX_CONTENT; | 254 return SECCOMP_MESSAGE_FUTEX_CONTENT; |
250 } | 255 } |
251 | 256 |
252 } // namespace sandbox. | 257 } // namespace sandbox. |
OLD | NEW |