title: Close all File Handles when Calling posix_spawn
body: <p>I'd like to spawn a collection of processes using posix_spawn(...) (or something very similar). This function accept an argument of type posix_spawn_file_actions_t, which allows me specify how the open file handles should be treated. From what I can ascertain from <a href="http://linux.die.net/man/3/posix_spawn" rel="noreferrer">the documentation</a>, all files are inherited from the calling processes and modified according the information in the posix_spawn_file_actions_t structure. </p>
  
  <p>I want all files to be unopened by the spawned process (except for stdin, stdout, and stderr). Does anyone know how to accomplish this? Apparently this can be done on some implementations usinf the 'POSIX_SPAWN_CLOEXEC_DEFAULT' spawn attribute flag, but this isn't available on my platform. I could also use <a href="http://linux.die.net/man/2/fcntl" rel="noreferrer">fcntl(...)</a> to specify 'close on exec' whenever I open a file, but I feel that a more localised solution to this problem would be preferable.</p>