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

Side by Side Diff: tests/test_patching.cc

Issue 10384174: Include <unistd.h>, as we are otherwise missing definitions on some systems. (Closed) Base URL: http://seccompsandbox.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 7 months 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 | « no previous file | no next file » | 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) 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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698