I have a large program. It very likes to open files (works with them, amount can be giant - more then 10k ). At some point I want to born a subprocess which will live its own life ( out-of-proc web browser ). I don't control who and how creates files in my main program by reason of its size ( > 10GB of code ) and third-party (plug-ins as well) dependencies. I'd want either:
- O_CLOEXEC / FD_CLOEXEC by default. I suspect there is no such ability. Or
- a way to enumerate all file (socket,pipe so on) descriptors in order to be able to close them after fork. Operation systems of interest: Mac OS X and Linux.