OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <fcntl.h> | 5 #include <fcntl.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <unistd.h> |
7 #include <sys/time.h> | 8 #include <sys/time.h> |
8 | 9 |
9 #include "library.h" | 10 #include "library.h" |
10 #include "sandbox.h" | 11 #include "sandbox.h" |
11 #include "test_runner.h" | 12 #include "test_runner.h" |
12 | 13 |
13 | 14 |
14 extern "C" int my_getpid(void); | 15 extern "C" int my_getpid(void); |
15 extern char my_getpid_end[]; | 16 extern char my_getpid_end[]; |
16 | 17 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 check_patching_vsyscall((char *) my_vgetcpu, my_vgetcpu_end); | 124 check_patching_vsyscall((char *) my_vgetcpu, my_vgetcpu_end); |
124 | 125 |
125 StartSeccompSandbox(); | 126 StartSeccompSandbox(); |
126 // glibc's sched_getcpu() could still succeed if it goes via the | 127 // glibc's sched_getcpu() could still succeed if it goes via the |
127 // vdso and just reads memory, but my_vgetcpu() is always redirected | 128 // vdso and just reads memory, but my_vgetcpu() is always redirected |
128 // through the sandbox's handler and is rejected. | 129 // through the sandbox's handler and is rejected. |
129 CHECK(my_vgetcpu(NULL, NULL, NULL) == -ENOSYS); | 130 CHECK(my_vgetcpu(NULL, NULL, NULL) == -ENOSYS); |
130 } | 131 } |
131 | 132 |
132 #endif | 133 #endif |
OLD | NEW |