Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: base/reserved_file_descriptors.h

Issue 115773: Prototype implementation of zygotes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util_linux.cc ('k') | base/zygote_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/reserved_file_descriptors.h
===================================================================
--- base/reserved_file_descriptors.h (revision 0)
+++ base/reserved_file_descriptors.h (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2009 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.
+
+#ifndef BASE_RESERVED_FILE_DESCRIPTORS_H_
+#define BASE_RESERVED_FILE_DESCRIPTORS_H_
+
+#if defined(OS_POSIX)
+
+// Chrome uses predefined file descriptors to communicate with child processes.
+// Normally this is a private contract between code that does fork/exec and the
+// code it invokes, but in zygote mode, things get a little more interesting.
+// It's a huge layering violation for this to be in base, but
+// logging and ZygoteManager need kReservedFileDescriptors, so there.
+
+enum GlobalReservedFds {
+ // Classic unix file descriptors.
+ // Let's leave them alone even if we don't use them.
+ kStdinFd = 0,
+ kStdoutFd = 1,
+ kStderrFd = 2,
+
+ // See chrome/common/ipc_channel_posix.cc
+ kClientChannelFd = 3,
+
+ // See chrome/app/breakpad_linux.cc and
+ // chrome/browser/renderer_host/browser_render_process_host.cc
+ kMagicCrashSignalFd = 4,
+
+ // One plus highest fd mentioned in this enum.
+ kReservedFds = 5
+};
+
+#endif
+
+#endif
« no previous file with comments | « base/process_util_linux.cc ('k') | base/zygote_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698