title: C - Child Process Not Executing
body: <p>[SOLVED]
  So for this practice exercise I was assigned we are practicing process control. I'm simply wondering why it seems that my child process will never execute (when child_pid == 0). Any help on this issue would be greatly appreciated!
  Also, safe_fork() is a function our instructor wrote in order to avoid students opening too many processes.</p>
  
  <pre><code>#include "safe-fork.h"
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/types.h&gt;
  
  int main(void) {
  
    pid_t child_pid;
    int pipefd[2];
    int pipe_result;
    int count;
  
    pipe_result = pipe(pipefd);
  
    if (pipe_result == -1) {
      perror("pipe failure");
      exit(1);
    }
  
    child_pid = safe_fork();
  
    /*Parent Process*/
    if (child_pid &gt; 0) {
      dup2(pipefd[0], STDIN_FILENO);
      scanf("%d", &amp;count);
  
      if (count &gt; 200) {
        printf("Long enough!\n");
        exit(0);
      }
      else {
        printf("Too short!\n");
        exit(1);
      }
  
    }
    /* Child Process */
    else {
      dup2(pipefd[1], STDOUT_FILENO);
      execl("/usr/bin/wc", "-w");
    }
    return 0;
  }
  </code></pre>