From 35355fc1fcffbe859395e360c0a6a1463f137d63 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Mar 2012 20:29:00 +0100 Subject: Set the close-on-exec flag on file descriptors --- src/libutil/util.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libutil/util.hh') diff --git a/src/libutil/util.hh b/src/libutil/util.hh index a1cf68e69d..ee0f3862a8 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -258,6 +258,9 @@ string runProgram(Path program, bool searchPath = false, listed in the given set. Good practice in child processes. */ void closeMostFDs(const set & exceptions); +/* Set the close-on-exec flag for the given file descriptor. */ +void closeOnExec(int fd); + /* Wrapper around _exit() on Unix and ExitProcess() on Windows. (On Cygwin, _exit() doesn't seem to do the right thing.) */ void quickExit(int status); -- cgit 1.4.1