title: fork() and system() calls not working as I expect
body: <p>I'm playing with the fork() and system() commands and when I run this example code I find that the child process doesn't print the "Song complete..." line after the system call is finished.
  Is this normal or have I missed something?  </p>
  
  <p>I thought system() would have finished its work then returned to the child process and gone on its merry way to either exit or do additional tasks.  That doesn't happen for this code example.</p>
  
  <pre><code>     #include &lt;sys/types.h&gt; /* pid_t */
       #include &lt;sys/wait.h&gt;  /* waitpid */
       #include &lt;stdio.h&gt;     /* printf, perror */
       #include &lt;stdlib.h&gt;    /* exit */
       #include &lt;unistd.h&gt;    /* _exit, fork */
  
       int main(void)
       {
         pid_t pid;
         int i;
         pid = fork();
  
         if (pid == -1) {
            /*
             * When fork() returns -1, an error happened.
             */
            perror("fork failed");
            exit(EXIT_FAILURE);
         }
         else if (pid == 0) {
            /*
             * When fork() returns 0, we are in the child process.
             */
            printf("Hello from the child process!\n");
              system("aplay ./SOS_sample.wav");
            printf("Song complete...");
            _exit(EXIT_SUCCESS);  /* exit() is unreliable here, so _exit must be used */
         }
         else {
            /*
             * When fork() returns a positive number, we are in the parent process
             * and the return value is the PID of the newly created child process.
             */
            int status;
              printf("Waiting on the song to end...\n");
              for (i = 0;i&lt;10;i++){
                      printf("%d\n",i);
                      }
            (void)waitpid(pid, &amp;status, 0);
              for (i=0;i&lt;10;i++){
                      printf("%d\n",i);
                      }
         }
         return EXIT_SUCCESS;
       }
  </code></pre>