OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 #endif | 25 #endif |
26 | 26 |
27 #include <string> | 27 #include <string> |
28 #include <utility> | 28 #include <utility> |
29 #include <vector> | 29 #include <vector> |
30 | 30 |
31 #include "base/command_line.h" | 31 #include "base/command_line.h" |
32 #include "base/file_path.h" | 32 #include "base/file_path.h" |
33 #include "base/process.h" | 33 #include "base/process.h" |
34 | 34 |
| 35 #ifndef NAME_MAX // Solaris and some BSDs have no NAME_MAX |
| 36 #ifdef MAXNAMLEN |
| 37 #define NAME_MAX MAXNAMLEN |
| 38 #else |
| 39 #define NAME_MAX 256 |
| 40 #endif |
| 41 #endif |
| 42 |
35 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
36 typedef PROCESSENTRY32 ProcessEntry; | 44 typedef PROCESSENTRY32 ProcessEntry; |
37 typedef IO_COUNTERS IoCounters; | 45 typedef IO_COUNTERS IoCounters; |
38 #elif defined(OS_POSIX) | 46 #elif defined(OS_POSIX) |
39 // TODO(port): we should not rely on a Win32 structure. | 47 // TODO(port): we should not rely on a Win32 structure. |
40 struct ProcessEntry { | 48 struct ProcessEntry { |
41 base::ProcessId pid; | 49 base::ProcessId pid; |
42 base::ProcessId ppid; | 50 base::ProcessId ppid; |
43 char szExeFile[NAME_MAX + 1]; | 51 char szExeFile[NAME_MAX + 1]; |
44 }; | 52 }; |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // instance running inside the parent. The parent's Breakpad instance should | 551 // instance running inside the parent. The parent's Breakpad instance should |
544 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 552 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
545 // in the child after forking will restore the standard exception handler. | 553 // in the child after forking will restore the standard exception handler. |
546 // See http://crbug.com/20371/ for more details. | 554 // See http://crbug.com/20371/ for more details. |
547 void RestoreDefaultExceptionHandler(); | 555 void RestoreDefaultExceptionHandler(); |
548 #endif | 556 #endif |
549 | 557 |
550 } // namespace base | 558 } // namespace base |
551 | 559 |
552 #endif // BASE_PROCESS_UTIL_H_ | 560 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |