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

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

Issue 570163003: Large IWYU cleanup for seccomp-bpf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trap-errorcode
Patch Set: Sort #includes Created 6 years, 3 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
« 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 "sandbox/linux/seccomp-bpf/die.h"
6
5 #include <errno.h> 7 #include <errno.h>
6 #include <linux/unistd.h> 8 #include <signal.h>
7 #include <stdio.h> 9 #include <stdio.h>
8 #include <sys/prctl.h> 10 #include <sys/prctl.h>
11 #include <sys/syscall.h>
12 #include <unistd.h>
9 13
10 #include <string> 14 #include <string>
11 15
12 #include "base/logging.h" 16 #include "base/logging.h"
13 #include "base/posix/eintr_wrapper.h" 17 #include "base/posix/eintr_wrapper.h"
14 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
15 #include "sandbox/linux/seccomp-bpf/syscall.h" 18 #include "sandbox/linux/seccomp-bpf/syscall.h"
16 19
17 namespace sandbox { 20 namespace sandbox {
18 21
19 void Die::ExitGroup() { 22 void Die::ExitGroup() {
20 // exit_group() should exit our program. After all, it is defined as a 23 // exit_group() should exit our program. After all, it is defined as a
21 // function that doesn't return. But things can theoretically go wrong. 24 // function that doesn't return. But things can theoretically go wrong.
22 // Especially, since we are dealing with system call filters. Continuing 25 // Especially, since we are dealing with system call filters. Continuing
23 // execution would be very bad in most cases where ExitGroup() gets called. 26 // execution would be very bad in most cases where ExitGroup() gets called.
24 // So, we'll try a few other strategies too. 27 // So, we'll try a few other strategies too.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // probably prefer them over a loop that blocks. 79 // probably prefer them over a loop that blocks.
77 ignore_result( 80 ignore_result(
78 HANDLE_EINTR(Syscall::Call(__NR_write, 2, s.c_str(), s.length()))); 81 HANDLE_EINTR(Syscall::Call(__NR_write, 2, s.c_str(), s.length())));
79 } 82 }
80 } 83 }
81 84
82 bool Die::simple_exit_ = false; 85 bool Die::simple_exit_ = false;
83 bool Die::suppress_info_ = false; 86 bool Die::suppress_info_ = false;
84 87
85 } // namespace sandbox 88 } // namespace sandbox
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