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 <asm/unistd.h> | 5 #include <asm/unistd.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <sys/mman.h> | 7 #include <sys/mman.h> |
| 8 #include <sys/syscall.h> |
8 #include <unistd.h> | 9 #include <unistd.h> |
9 | 10 |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
13 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
14 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" | 15 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" |
15 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 16 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
16 #include "sandbox/linux/seccomp-bpf/syscall.h" | 17 #include "sandbox/linux/seccomp-bpf/syscall.h" |
17 #include "sandbox/linux/tests/unit_tests.h" | 18 #include "sandbox/linux/tests/unit_tests.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 EXPECT_EQ(8192, SandboxSyscall(__NR_read, fd, buf, 8192L)); | 176 EXPECT_EQ(8192, SandboxSyscall(__NR_read, fd, buf, 8192L)); |
176 EXPECT_EQ(0, memcmp(addr2, buf, 8192)); | 177 EXPECT_EQ(0, memcmp(addr2, buf, 8192)); |
177 | 178 |
178 // Clean up | 179 // Clean up |
179 EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr2, 8192L)); | 180 EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr2, 8192L)); |
180 EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr3, 4096L)); | 181 EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr3, 4096L)); |
181 EXPECT_EQ(0, HANDLE_EINTR(SandboxSyscall(__NR_close, fd))); | 182 EXPECT_EQ(0, HANDLE_EINTR(SandboxSyscall(__NR_close, fd))); |
182 } | 183 } |
183 | 184 |
184 } // namespace | 185 } // namespace |
OLD | NEW |