title: What does the second parameter of waitpid() mean?
body: <p>From a existing question <a href="https://stackoverflow.com/questions/3664854">here</a>, someone gave this example code:</p>
  
  <pre><code>int status;
  child_pid = fork();
  if (child_pid == 0) {
       // in child; do stuff including perhaps exec
  } else if (child_pid == -1) {
       // failed to fork 
  } else {
       if (waitpid(child_pid, &amp;status, 0) == child_pid) {
            // child exited or interrupted; now you can do something with status
       } else {
            // error etc
       }
   }
  </code></pre>
  
  <p>Could anyone explain to me what the second parameter of <code>waitpid()</code> is used for?</p>