On Unix, I'm aware that after calling fork(), I need to reset my signal mask and close file descriptors that I don't want the child to have, before calling exec().
But, what else might I need to do?
Is there a comprehensive doc somewhere that lists all the things that you might want to clean up when forking a child process in order to give it a nice standard execution environment?
I'm currently on Linux, but I'd like a document that includes details for other Unixes as well, possibly with ways to autoconf-test for them.
fork(3)
provides a comprehensive list. It's a bit long to quote here but as per SO policy I'll do so anyway: