| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |