summaryrefslogtreecommitdiffstats
path: root/base/process/launch.h
diff options
context:
space:
mode:
authorrickyz <rickyz@chromium.org>2015-01-13 14:59:48 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-13 23:00:58 +0000
commitf1eb9ccb53367a38340b05caa74769c7b492ad73 (patch)
treee9a1f4ca07910d4bf17c44d7d8b02968ab233590 /base/process/launch.h
parentecbbe049cd76030e07a7fe53fc5bd9de4c0d8804 (diff)
downloadchromium_src-f1eb9ccb53367a38340b05caa74769c7b492ad73.zip
chromium_src-f1eb9ccb53367a38340b05caa74769c7b492ad73.tar.gz
chromium_src-f1eb9ccb53367a38340b05caa74769c7b492ad73.tar.bz2
Move ForkWithFlags from sandbox/ to base/ and plug it into LaunchProcess.
ForkWithFlags is a wrapper around the clone syscall that uses the libc clone wrapper, and thus updates the libc's pid cache if it has one (using sys_clone directly does not update the pid cache, so getpid may return an incorrect result in the child). This exposes the ability to set clone flags, which is needed to use Linux namespaces. BUG=312380 Review URL: https://codereview.chromium.org/840893003 Cr-Commit-Position: refs/heads/master@{#311356}
Diffstat (limited to 'base/process/launch.h')
-rw-r--r--base/process/launch.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/process/launch.h b/base/process/launch.h
index 6cd02d6..e9fb3b9 100644
--- a/base/process/launch.h
+++ b/base/process/launch.h
@@ -115,6 +115,9 @@ struct BASE_EXPORT LaunchOptions {
#if defined(OS_LINUX)
// If non-zero, start the process using clone(), using flags as provided.
+ // Unlike in clone, clone_flags may not contain a custom termination signal
+ // that is sent to the parent when the child dies. The termination signal will
+ // always be set to SIGCHLD.
int clone_flags;
// By default, child processes will have the PR_SET_NO_NEW_PRIVS bit set. If