Review request for 5049299

Christos Zoulas christos at
Wed Jul 1 00:18:31 UTC 2009

On Jun 30,  4:39pm, martinrb at (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
| on
| 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 mailing list