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

Unified Diff: base/process_util.h

Issue 100127: POSIX: Add code for shuffling file descriptors. (Closed)
Patch Set: ... Created 11 years, 8 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/file_descriptor_shuffle_unittest.cc ('k') | base/process_util_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util.h
diff --git a/base/process_util.h b/base/process_util.h
index a692870c7e5c5540c8f1d0b9fdec81ff40bb8c2b..d20a0f9abc1c029d3ab12d13645ced7af56ec934 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -44,6 +44,8 @@ struct IoCounters {
unsigned long long WriteTransferCount;
unsigned long long OtherTransferCount;
};
+
+#include "base/file_descriptor_shuffle.h"
#endif
#if defined(OS_MACOSX)
@@ -82,7 +84,14 @@ ProcessId GetProcId(ProcessHandle process);
#if defined(OS_POSIX)
// Sets all file descriptors to close on exec except for stdin, stdout
// and stderr.
+// TODO(agl): remove this function
+// WARNING: do not use. It's inherently race-prone in the face of
+// multi-threading.
void SetAllFDsToCloseOnExec();
+// Close all file descriptors, expect those which are a destination in the
+// given multimap. Only call this function in a child process where you know
+// that there aren't any other threads.
+void CloseSuperfluousFds(const base::InjectiveMultimap& saved_map);
#endif
#if defined(OS_WIN)
« no previous file with comments | « base/file_descriptor_shuffle_unittest.cc ('k') | base/process_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698