OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ |
7 | 7 |
8 #include <endian.h> | 8 #include <endian.h> |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 #endif | 159 #endif |
160 | 160 |
161 #if defined(SECCOMP_BPF_STANDALONE) | 161 #if defined(SECCOMP_BPF_STANDALONE) |
162 #define arraysize(x) (sizeof(x)/sizeof(*(x))) | 162 #define arraysize(x) (sizeof(x)/sizeof(*(x))) |
163 #define HANDLE_EINTR TEMP_FAILURE_RETRY | 163 #define HANDLE_EINTR TEMP_FAILURE_RETRY |
164 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ | 164 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ |
165 TypeName(); \ | 165 TypeName(); \ |
166 TypeName(const TypeName&); \ | 166 TypeName(const TypeName&); \ |
167 void operator=(const TypeName&) | 167 void operator=(const TypeName&) |
| 168 |
| 169 template <bool> |
| 170 struct CompileAssert { |
| 171 }; |
| 172 #define COMPILE_ASSERT(expr, msg) \ |
| 173 typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] |
168 #endif | 174 #endif |
169 | 175 |
170 #include "sandbox/linux/seccomp-bpf/die.h" | 176 #include "sandbox/linux/seccomp-bpf/die.h" |
171 #include "sandbox/linux/seccomp-bpf/errorcode.h" | 177 #include "sandbox/linux/seccomp-bpf/errorcode.h" |
172 | 178 |
173 namespace playground2 { | 179 namespace playground2 { |
174 | 180 |
175 struct arch_seccomp_data { | 181 struct arch_seccomp_data { |
176 int nr; | 182 int nr; |
177 uint32_t arch; | 183 uint32_t arch; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 static TrapIds trapIds_; | 401 static TrapIds trapIds_; |
396 static ErrorCode *trapArray_; | 402 static ErrorCode *trapArray_; |
397 static size_t trapArraySize_; | 403 static size_t trapArraySize_; |
398 static bool has_unsafe_traps_; | 404 static bool has_unsafe_traps_; |
399 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox); | 405 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox); |
400 }; | 406 }; |
401 | 407 |
402 } // namespace | 408 } // namespace |
403 | 409 |
404 #endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ | 410 #endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ |
OLD | NEW |