Quote:
Originally Posted by
vino
I was told that you generally need to close only 64 fds instead of the RLIMIT.rlim_cur after forking. Any thoughts ?
You need to close the file descriptors you need to close.
The number 64 comes from some editions of UNIX's hard coded limit.
There are alternatives...
1. If the reason is the program is going to call 'exec' then the code that opens the file descriptors could set the close-on-exec bit.
2. Modular threaded code could use pthead_atfork to set up a call back to close a file descriptor if required.