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 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_ | 5 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_ |
6 #define BASE_PROCESS_PROCESS_PROCESS_H_ | 6 #define BASE_PROCESS_PROCESS_PROCESS_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/move.h" | 10 #include "base/move.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
105 | 105 |
106 private: | 106 private: |
107 #if defined(OS_WIN) | 107 #if defined(OS_WIN) |
108 bool is_current_process_; | 108 bool is_current_process_; |
109 win::ScopedHandle process_; | 109 win::ScopedHandle process_; |
110 #else | 110 #else |
111 ProcessHandle process_; | 111 ProcessHandle process_; |
112 #endif | 112 #endif |
113 }; | 113 }; |
114 | 114 |
115 #if defined(OS_LINUX) | |
116 // A wrapper for clone with fork-like behavior, meaning that it returns the | |
117 // child's pid in the parent and 0 in the child. |flags|, |ptid|, and |ctid| are | |
118 // as in the clone system call (the CLONE_VM flag is not supported). | |
119 // | |
120 // This function uses the libc clone wrapper (which updates libc's pid cache) | |
121 // internally, so callers may expect things like getpid() to work correctly | |
122 // after in both the child and parent. An exception is when this code is run | |
123 // under Valgrind. Valgrind does not support the libc clone wrapper, so the libc | |
124 // pid cache may be incorrect after this function is called under Valgrind. | |
125 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); | |
jln (very slow on Chromium)
2015/01/06 00:22:31
It may be useful to warn about the usual fork() is
rickyz (no longer on Chrome)
2015/01/06 02:45:37
Done.
| |
126 #endif | |
127 | |
115 } // namespace base | 128 } // namespace base |
116 | 129 |
117 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ | 130 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ |
OLD | NEW |