On Jun 30,  4:39pm, marti...@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
| 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.

christos

Reply via email to