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

Side by Side Diff: sandbox/linux/services/syscall_wrappers.cc

Issue 1029283003: WIP: Implement seccomp-bpf sandbox for nacl_helper_nonsfi. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/services/syscall_wrappers.h" 5 #include "sandbox/linux/services/syscall_wrappers.h"
6 6
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <sched.h> 8 #include <sched.h>
9 #include <setjmp.h> 9 #include <setjmp.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
11 #include <sys/syscall.h> 11 #include <sys/syscall.h>
12 #include <sys/time.h> 12 #include <sys/time.h>
13 #include <sys/types.h> 13 #include <sys/types.h>
14 #include <unistd.h> 14 #include <unistd.h>
15 15
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/third_party/valgrind/valgrind.h" 18 #include "base/third_party/valgrind/valgrind.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "sandbox/linux/system_headers/linux_signal.h"
20 #include "sandbox/linux/system_headers/linux_syscalls.h" 21 #include "sandbox/linux/system_headers/linux_syscalls.h"
21 22
22 namespace sandbox { 23 namespace sandbox {
23 24
24 pid_t sys_getpid(void) { 25 pid_t sys_getpid(void) {
25 return syscall(__NR_getpid); 26 return syscall(__NR_getpid);
26 } 27 }
27 28
28 pid_t sys_gettid(void) { 29 pid_t sys_gettid(void) {
29 return syscall(__NR_gettid); 30 return syscall(__NR_gettid);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 79 }
79 80
80 int sys_capget(cap_hdr* hdrp, cap_data* datap) { 81 int sys_capget(cap_hdr* hdrp, cap_data* datap) {
81 return syscall(__NR_capget, hdrp, datap); 82 return syscall(__NR_capget, hdrp, datap);
82 } 83 }
83 84
84 int sys_capset(cap_hdr* hdrp, const cap_data* datap) { 85 int sys_capset(cap_hdr* hdrp, const cap_data* datap) {
85 return syscall(__NR_capset, hdrp, datap); 86 return syscall(__NR_capset, hdrp, datap);
86 } 87 }
87 88
89 int sys_sigprocmask(
90 int how, const linux_sigset_t* set, linux_sigset_t* oldset) {
91 return syscall(__NR_rt_sigprocmask, how, set, oldset, sizeof(*set));
92 }
93
94 int sys_sigaction(int signum, const struct linux_sigaction* act,
95 struct linux_sigaction* oldact) {
96 // TODO: Do we need to return an error if act has SA_RESTORE?
97 return syscall(__NR_rt_sigaction, signum, act, oldact, sizeof(act->sa_mask));
98 }
99
88 } // namespace sandbox 100 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/services/syscall_wrappers.h ('k') | sandbox/linux/system_headers/android_i386_ucontext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698