Comment 12 for bug 102408

Revision history for this message
In , Wan-Teh Chang (wtc-google) wrote :

The default inherit trait of a file descriptor opened via
PR_Open() is inheritable on Unix and not-inheritable on Windows.

There is no convenient way to set all file descriptors opened
by an application not-inheritable by a child process on Unix.
I've seen people who resort to a for loop that closes all the
possible Unix fd's. That for loop is rather expensive.

A possible solution is to use a helper process whose only
purpose is to fork and exec helper apps for the Mozilla client.
You know exactly which file descriptors are open in this helper
process and you can set FD_CLOEXEC on all these fd's.