diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-03-05T19·29+0100 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-03-05T19·29+0100 |
commit | 35355fc1fcffbe859395e360c0a6a1463f137d63 (patch) | |
tree | 0d5ed221e64ca64303c2f88dcf68cc054ba5e8e6 /src/libutil/util.hh | |
parent | 7b22bec252a155514d811a8e2acc21562ac02bd4 (diff) |
Set the close-on-exec flag on file descriptors
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r-- | src/libutil/util.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index a1cf68e69d1c..ee0f3862a872 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<int> & 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); |