title: c - fork() code
body: <pre><code>void main ()
  {
     if ( fork () )
     {
         printf ( "PID1 %d\n", getpid () );
     }
     else
     {
         printf ( "PID2 %d\n", getpid () );
     }
  }
  </code></pre>
  
  <p>What does this code do? I know it has something to do with process IDs but shouldn't fork return something into the condition to determine whether it's a child/parent process?</p>