title: How can parents waits all child processes finish then exit when it receives SIGINT?
body: <p>I'm writing a multi process program in C. </p>
  
  <p>I hope parents process can wait all child processes finish then exit when 
  it receives SIGINT. </p>
  
  <p>I have two questions.</p>
  
  <ol>
  <li><p>How can parents record each pid of child process it forked. 
  Child process may finish before recording function run on 
  main process. </p></li>
  <li><p>If parents has no idea about how many child processes it has. How can he wait 
  all child process finish. </p></li>
  </ol>
  
  <p>Thanks in advance. </p>