title: execve : convert execve call to fork
body: <p>I have an execve system call to overlay my curernt program with another one. The code works fine but I my requirement is to change this execve system call with fork system call. I am trying something like below:</p>
  
  <pre><code>pid_t child_pid;
  child_pid = fork();
  if(child_pid == 0) {
         if (-1 == execve(...)) //Normal previous execve call
         {
            .............
         }
  }
  else
  { //fork parent process
  exit(0);
  }
  </code></pre>
  
  <p>I am not sure that when we are replacing an execve system call by fork what things we should take care. In my child process I am calling the existing execve call to let the original flow be maintained (as if without fork) but what should the parent do - should I normally exit or I need to wait for the child process to exit/die. The execve call overlays the current process with a new one so there is no question of parent / child process.</p>