title: how to redirect posix_spawn stdout to /dev/null
body: <p>I have the following code:</p>
  
  <pre><code>pid_t pid;
  char *argv[] = {"execpath", NULL};
  int status;
  extern char **environ;    
  status = posix_spawn(&amp;pid, "execpath", NULL, NULL, argv, environ);
  </code></pre>
  
  <p>How can I redirect the child process <code>STDOUT</code> to <code>/dev/null</code>?</p>