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_LINUX_SECCOMP_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_LINUX_SECCOMP_H__ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_LINUX_SECCOMP_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_LINUX_SECCOMP_H__ |
7 | 7 |
8 // The Seccomp2 kernel ABI is not part of older versions of glibc. | 8 // The Seccomp2 kernel ABI is not part of older versions of glibc. |
9 // As we can't break compilation with these versions of the library, | 9 // As we can't break compilation with these versions of the library, |
10 // we explicitly define all missing symbols. | 10 // we explicitly define all missing symbols. |
11 // If we ever decide that we can now rely on system headers, the following | 11 // If we ever decide that we can now rely on system headers, the following |
12 // include files should be enabled: | 12 // include files should be enabled: |
13 // #include <linux/audit.h> | 13 // #include <linux/audit.h> |
14 // #include <linux/seccomp.h> | 14 // #include <linux/seccomp.h> |
15 | 15 |
16 #include <asm/unistd.h> | 16 #include <asm/unistd.h> |
17 #include <linux/filter.h> | 17 #include <linux/filter.h> |
18 | 18 |
19 #include <sys/cdefs.h> | 19 #include <sys/cdefs.h> |
20 // Old Bionic versions do not have sys/user.h. The if can be removed once we no | 20 // Old Bionic versions do not have sys/user.h. The if can be removed once we no |
21 // longer need to support these old Bionic versions. | 21 // longer need to support these old Bionic versions. |
22 // All x86_64 builds use a new enough bionic to have sys/user.h. | 22 // All x86_64 builds use a new enough bionic to have sys/user.h. |
23 #if !defined(__BIONIC__) || defined(__x86_64__) | 23 #if !defined(__BIONIC__) || defined(__x86_64__) |
| 24 #include <sys/types.h> // Fix for gcc 4.7, make sure __uint16_t is defined. |
24 #include <sys/user.h> | 25 #include <sys/user.h> |
25 #endif | 26 #endif |
26 | 27 |
27 // For audit.h | 28 // For audit.h |
28 #ifndef EM_ARM | 29 #ifndef EM_ARM |
29 #define EM_ARM 40 | 30 #define EM_ARM 40 |
30 #endif | 31 #endif |
31 #ifndef EM_386 | 32 #ifndef EM_386 |
32 #define EM_386 3 | 33 #define EM_386 3 |
33 #endif | 34 #endif |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 #define SECCOMP_PT_PARM4(_regs) (_regs).REG_r3 | 286 #define SECCOMP_PT_PARM4(_regs) (_regs).REG_r3 |
286 #define SECCOMP_PT_PARM5(_regs) (_regs).REG_r4 | 287 #define SECCOMP_PT_PARM5(_regs) (_regs).REG_r4 |
287 #define SECCOMP_PT_PARM6(_regs) (_regs).REG_r5 | 288 #define SECCOMP_PT_PARM6(_regs) (_regs).REG_r5 |
288 | 289 |
289 #else | 290 #else |
290 #error Unsupported target platform | 291 #error Unsupported target platform |
291 | 292 |
292 #endif | 293 #endif |
293 | 294 |
294 #endif // SANDBOX_LINUX_SECCOMP_BPF_LINUX_SECCOMP_H__ | 295 #endif // SANDBOX_LINUX_SECCOMP_BPF_LINUX_SECCOMP_H__ |
OLD | NEW |