title: Make child process wait for parent
body: <p>I have to write a program in C that will <code>fork</code> a new process and then use that processes <code>pid</code> for another function. However I need to call this function before the child process can run and I don't know how to do this.</p>
  
  <p>Here's some pseudo code of what I'm trying to do.</p>
  
  <pre><code>pid_t pid = fork();
  if(in_child){    //In the child process
      //launch child application
      //somehow stop the child application before it actually executes any code
  }
  else{
      //call my function with the child's pid
      //resume the child process
      //do other stuff
  }
  </code></pre>
  
  <p>If you need any additional info please ask. Thanks.</p>
  
  <p>Edit: I do not have access to the code for the child.  I'm just wanting to run an executable.</p>