in reply to How to close all open file descriptors after a fork?

Check out these two threads:
  • Comment on Re: How to close all open file descriptors after a fork?