Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: sandbox/linux/seccomp-bpf/syscall_unittest.cc

Issue 11612014: Linux sandbox: modify GYP files to compile under Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add linux_syscalls.h Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf/syscall.cc ('k') | sandbox/sandbox.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/syscall.cc ('k') | sandbox/sandbox.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698