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

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

Issue 12223109: SECCOMP-BPF: Refactor the BPF sandbox API to use fewer "static" fields and methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 10 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 | « sandbox/linux/seccomp-bpf/die.h ('k') | sandbox/linux/seccomp-bpf/errorcode.h » ('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 <errno.h>
6 #include <linux/unistd.h>
7 #include <stdio.h>
8 #include <sys/prctl.h>
9
5 #include <string> 10 #include <string>
6 11
7 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" 12 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
8 #include "sandbox/linux/seccomp-bpf/syscall.h" 13 #include "sandbox/linux/seccomp-bpf/syscall.h"
9 14
10 15
11 namespace playground2 { 16 namespace playground2 {
12 17
13 void Die::ExitGroup() { 18 void Die::ExitGroup() {
14 // exit_group() should exit our program. After all, it is defined as a 19 // exit_group() should exit our program. After all, it is defined as a
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // No need to loop. Short write()s are unlikely and if they happen we 74 // No need to loop. Short write()s are unlikely and if they happen we
70 // probably prefer them over a loop that blocks. 75 // probably prefer them over a loop that blocks.
71 if (HANDLE_EINTR(SandboxSyscall(__NR_write, 2, s.c_str(), s.length()))) { } 76 if (HANDLE_EINTR(SandboxSyscall(__NR_write, 2, s.c_str(), s.length()))) { }
72 } 77 }
73 } 78 }
74 79
75 bool Die::simple_exit_ = false; 80 bool Die::simple_exit_ = false;
76 bool Die::suppress_info_ = false; 81 bool Die::suppress_info_ = false;
77 82
78 } // namespace 83 } // namespace
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/die.h ('k') | sandbox/linux/seccomp-bpf/errorcode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698