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 #include "sandbox/linux/seccomp-bpf/syscall.h" |
| 6 |
5 #include <asm/unistd.h> | 7 #include <asm/unistd.h> |
6 #include <fcntl.h> | 8 #include <fcntl.h> |
7 #include <sys/mman.h> | 9 #include <sys/mman.h> |
8 #include <sys/syscall.h> | 10 #include <sys/syscall.h> |
| 11 #include <sys/types.h> |
9 #include <unistd.h> | 12 #include <unistd.h> |
10 | 13 |
11 #include <vector> | 14 #include <vector> |
12 | 15 |
13 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
14 #include "base/posix/eintr_wrapper.h" | 17 #include "base/posix/eintr_wrapper.h" |
15 #include "build/build_config.h" | 18 #include "build/build_config.h" |
16 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" | 19 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" |
17 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 20 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
18 #include "sandbox/linux/seccomp-bpf/syscall.h" | |
19 #include "sandbox/linux/tests/unit_tests.h" | 21 #include "sandbox/linux/tests/unit_tests.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
21 | 23 |
22 namespace sandbox { | 24 namespace sandbox { |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 // Different platforms use different symbols for the six-argument version | 28 // Different platforms use different symbols for the six-argument version |
27 // of the mmap() system call. Test for the correct symbol at compile time. | 29 // of the mmap() system call. Test for the correct symbol at compile time. |
28 #ifdef __NR_mmap2 | 30 #ifdef __NR_mmap2 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 207 |
206 // Clean up | 208 // Clean up |
207 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr2, 8192L)); | 209 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr2, 8192L)); |
208 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr3, 4096L)); | 210 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr3, 4096L)); |
209 EXPECT_EQ(0, IGNORE_EINTR(Syscall::Call(__NR_close, fd))); | 211 EXPECT_EQ(0, IGNORE_EINTR(Syscall::Call(__NR_close, fd))); |
210 } | 212 } |
211 | 213 |
212 } // namespace | 214 } // namespace |
213 | 215 |
214 } // namespace sandbox | 216 } // namespace sandbox |
OLD | NEW |