title: How to create a process on Mac OS using fork() and exec()
body: <p>I am working on a relatively simple, independent "<em>process starter</em>" that I would like to get to work on Windows (XP, Vista, 7), Linux (Ubuntu 10.10) and especially <strong>Mac OS X</strong> (10.6). Linux and Windows basically work, but I'm having some trouble with the Mac version.
  I was hoping <code>fork()</code> and <code>exec()</code> functions would work the same way under Mac OS as they work in Linux. So my first question is:</p>
  
  <ol>
  <li><strong>Should I use these to create a
  process on the Mac or are there any
  platform specific functions to be
  used?</strong></li>
  </ol>
  
  <p>My current code (which worked fine under Linux) to debug this looks something like this:</p>
  
  <pre><code>pid_t processId = 0;
  if (processId = fork()) == 0)
  {
      const char * tmpApplication = "/Path/to/TestApplication";
  
      int argc = 1;
      char * argv[argc + 1];
  
      argv[0] = tmpApplication;
      argv[1] = NULL;
  
      execv(tmpApplication, argv);
  }else
  {
      //[...]
  }
  </code></pre>
  
  <p><strong>Any idea if this could work under Mac OS X as well, because my child process is simply not being launched, while there are no errors that would come up.</strong></p>
  
  <p>Thank you!</p>