about summary refs log tree commit diff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r--src/libutil/util.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 5d28a8308c..6c67e450b5 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -245,6 +245,10 @@ void killUser(uid_t uid);
 string runProgram(Path program, bool searchPath = false,
     const Strings & args = Strings());
 
+/* Close all file descriptors except stdin, stdout, stderr, and those
+   listed in the given set.  Good practice in child processes. */
+void closeMostFDs(const set<int> & exceptions);
+
 /* Wrapper around _exit() on Unix and ExitProcess() on Windows.  (On
    Cygwin, _exit() doesn't seem to do the right thing.) */
 void quickExit(int status);