| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Returns the ProcessHandle of the current process. | 61 // Returns the ProcessHandle of the current process. |
| 62 ProcessHandle GetCurrentProcessHandle(); | 62 ProcessHandle GetCurrentProcessHandle(); |
| 63 | 63 |
| 64 // Returns the unique ID for the specified process. This is functionally the | 64 // Returns the unique ID for the specified process. This is functionally the |
| 65 // same as Windows' GetProcessId(), but works on versions of Windows before | 65 // same as Windows' GetProcessId(), but works on versions of Windows before |
| 66 // Win XP SP1 as well. | 66 // Win XP SP1 as well. |
| 67 int GetProcId(ProcessHandle process); | 67 int GetProcId(ProcessHandle process); |
| 68 | 68 |
| 69 #if defined(OS_POSIX) | 69 #if defined(OS_POSIX) |
| 70 // Returns the maximum number of files that a process can have open. | 70 // Sets all file descriptors to close on exec except for stdin, stdout |
| 71 // Returns 0 on error. | 71 // and stderr. |
| 72 int GetMaxFilesOpenInProcess(); | 72 void SetAllFDsToCloseOnExec(); |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 76 // Runs the given application name with the given command line. Normally, the | 76 // Runs the given application name with the given command line. Normally, the |
| 77 // first command line argument should be the path to the process, and don't | 77 // first command line argument should be the path to the process, and don't |
| 78 // forget to quote it. | 78 // forget to quote it. |
| 79 // | 79 // |
| 80 // If wait is true, it will block and wait for the other process to finish, | 80 // If wait is true, it will block and wait for the other process to finish, |
| 81 // otherwise, it will just continue asynchronously. | 81 // otherwise, it will just continue asynchronously. |
| 82 // | 82 // |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 336 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
| 337 void EnableTerminationOnHeapCorruption(); | 337 void EnableTerminationOnHeapCorruption(); |
| 338 | 338 |
| 339 // If supported on the platform, and the user has sufficent rights, increase | 339 // If supported on the platform, and the user has sufficent rights, increase |
| 340 // the current process's scheduling priority to a high priority. | 340 // the current process's scheduling priority to a high priority. |
| 341 void RaiseProcessToHighPriority(); | 341 void RaiseProcessToHighPriority(); |
| 342 | 342 |
| 343 } // namespace base | 343 } // namespace base |
| 344 | 344 |
| 345 #endif // BASE_PROCESS_UTIL_H_ | 345 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |