title: Fork, sharing variables, & handling zombie processes
body: <p>I'm writing a program for some homework that's going to entail some forking, but I'm a little unclear on sharing variables and dealing with zombie processes.</p>
  
  <ol>
  <li><p>If I have global variables, do the parent and all children work with the same "copy" of those global variables? If not, is there some way I can get them to (<code>vfork</code>?)?</p></li>
  <li><p>I know what zombie processes are, but I'm not clear on how to get rid of them. My program will be spinning off lots of temporary processes so I don't know that I can <code>wait()</code> for each of them individually. When the parent process terminates, that gets rid of all zombies associated with it, right? What if the parent is terminated before a child? Will the child leave behind a zombie when it finishes (are these the ones <code>init()</code> clears out periodically)?</p></li>
  <li><p>Possibly sidestepping question 2 entirely, since I don't actually care about the results from the child processes, is there any way to have them not leave behind zombies at all? I saw something about <code>signal(SIGCHLD, SIG_IGN)</code> but I'm not sure how to use it, and the manpage for it I found was somewhat obtuse.</p></li>
  </ol>