| OLD | NEW |
| 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 "base/process_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <dirent.h> | 8 #include <dirent.h> |
| 9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <errno.h> | 10 #include <errno.h> |
| 11 #include <fcntl.h> | 11 #include <fcntl.h> |
| 12 #include <sys/sysctl.h> | 12 #include <sys/sysctl.h> |
| 13 #include <sys/time.h> | 13 #include <sys/time.h> |
| 14 #include <sys/types.h> | 14 #include <sys/types.h> |
| 15 #include <sys/user.h> | 15 #include <sys/user.h> |
| 16 #include <sys/wait.h> | 16 #include <sys/wait.h> |
| 17 #include <time.h> | 17 #include <time.h> |
| 18 #include <unistd.h> | 18 #include <unistd.h> |
| 19 | 19 |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/string_tokenizer.h" | 21 #include "base/string_tokenizer.h" |
| 22 #include "base/string_util.h" | |
| 23 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 24 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
| 24 #include "base/strings/string_util.h" |
| 25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 | 28 |
| 29 ProcessId GetParentProcessId(ProcessHandle process) { | 29 ProcessId GetParentProcessId(ProcessHandle process) { |
| 30 struct kinfo_proc info; | 30 struct kinfo_proc info; |
| 31 size_t length; | 31 size_t length; |
| 32 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process }; | 32 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process }; |
| 33 | 33 |
| 34 if (sysctl(mib, arraysize(mib), &info, &length, NULL, 0) < 0) | 34 if (sysctl(mib, arraysize(mib), &info, &length, NULL, 0) < 0) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 59 void EnableTerminationOnHeapCorruption() { | 59 void EnableTerminationOnHeapCorruption() { |
| 60 // Nothing to do. | 60 // Nothing to do. |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool AdjustOOMScore(ProcessId process, int score) { | 63 bool AdjustOOMScore(ProcessId process, int score) { |
| 64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace base | 68 } // namespace base |
| OLD | NEW |