Review request for 5049299
christos at zoulas.com
Wed Jul 1 00:18:31 UTC 2009
On Jun 30, 4:39pm, martinrb at google.com (Martin Buchholz) wrote:
-- Subject: Re: Review request for 5049299
| In the JDK...
| We close all non-relevant file descriptors in the child instead of relying
| having the FD_CLOEXEC bit set properly for every fd in the parent.
| The technique of choice appears to be to read /proc/self/fd and
| close all the fds found therein.
| That's even portable between linux and solaris!
Well, on solaris it is best to use closefrom(3C). I think some BSDs have it
too, AIX, IRIX. So perhaps detect if it is there and use that instead (
or fcntl(fd, F_CLOSEM) if it exists.
More information about the core-libs-dev