[go: nahoru, domu]

[ChromeOS] Add option to set controlling terminal when launching process.

This is needed to expose crosh process to hterm (if pseudo terminal used for
communication between terminalPrivateApi and crosh process is not controlling, job
control in the crosh process won't work, and it won't be able to e.g. process signals).

TEST=None
BUG=chromium-os:23273

Review URL: https://chromiumcodereview.appspot.com/9176013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118585 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/process_util.h b/base/process_util.h
index 9bcd6d4..bd13898 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -225,6 +225,9 @@
 #if defined(OS_LINUX)
                   , clone_flags(0)
 #endif  // OS_LINUX
+#if defined(OS_CHROMEOS)
+                  , ctrl_terminal_fd(-1)
+#endif  // OS_CHROMEOS
 #if defined(OS_MACOSX)
                   , synchronize(NULL)
 #endif  // defined(OS_MACOSX)
@@ -282,6 +285,12 @@
   int clone_flags;
 #endif  // defined(OS_LINUX)
 
+#if defined(OS_CHROMEOS)
+  // If non-negative, the specified file descriptor will be set as the launched
+  // process' controlling terminal.
+  int ctrl_terminal_fd;
+#endif  // defined(OS_CHROMEOS)
+
 #if defined(OS_MACOSX)
   // When non-NULL, a new LaunchSynchronizationHandle will be created and
   // stored in *synchronize whenever LaunchProcess returns true in the parent