OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 contains functions for launching subprocesses. | 5 // This file contains functions for launching subprocesses. |
6 | 6 |
7 #ifndef BASE_PROCESS_LAUNCH_H_ | 7 #ifndef BASE_PROCESS_LAUNCH_H_ |
8 #define BASE_PROCESS_LAUNCH_H_ | 8 #define BASE_PROCESS_LAUNCH_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If | 148 // By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If |
149 // true, then this bit will not be set in the new child process. | 149 // true, then this bit will not be set in the new child process. |
150 bool allow_new_privs = false; | 150 bool allow_new_privs = false; |
151 | 151 |
152 // Sets parent process death signal to SIGKILL. | 152 // Sets parent process death signal to SIGKILL. |
153 bool kill_on_parent_death = false; | 153 bool kill_on_parent_death = false; |
154 #endif // defined(OS_LINUX) | 154 #endif // defined(OS_LINUX) |
155 | 155 |
156 #if defined(OS_POSIX) | 156 #if defined(OS_POSIX) |
| 157 // If not empty, launch the specified executable instead of |
| 158 // cmdline.GetProgram(). This is useful when it is necessary to pass a custom |
| 159 // argv[0]. |
| 160 base::FilePath real_path; |
| 161 |
157 // If non-null, a delegate to be run immediately prior to executing the new | 162 // If non-null, a delegate to be run immediately prior to executing the new |
158 // program in the child process. | 163 // program in the child process. |
159 // | 164 // |
160 // WARNING: If LaunchProcess is called in the presence of multiple threads, | 165 // WARNING: If LaunchProcess is called in the presence of multiple threads, |
161 // code running in this delegate essentially needs to be async-signal safe | 166 // code running in this delegate essentially needs to be async-signal safe |
162 // (see man 7 signal for a list of allowed functions). | 167 // (see man 7 signal for a list of allowed functions). |
163 PreExecDelegate* pre_exec_delegate = nullptr; | 168 PreExecDelegate* pre_exec_delegate = nullptr; |
164 #endif // defined(OS_POSIX) | 169 #endif // defined(OS_POSIX) |
165 | 170 |
166 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // multiple threads are running, since at the time the fork happened, the | 304 // multiple threads are running, since at the time the fork happened, the |
300 // threads could have been in any state (potentially holding locks, etc.). | 305 // threads could have been in any state (potentially holding locks, etc.). |
301 // Callers should most likely call execve() in the child soon after calling | 306 // Callers should most likely call execve() in the child soon after calling |
302 // this. | 307 // this. |
303 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); | 308 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); |
304 #endif | 309 #endif |
305 | 310 |
306 } // namespace base | 311 } // namespace base |
307 | 312 |
308 #endif // BASE_PROCESS_LAUNCH_H_ | 313 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |