title: Implicit declaration of function ‘wait’
body: <p>I am getting a warning > Implicit declaration of function ‘wait’ &lt; and when I run the program it works correctly, I would like to understand why I am getting this warning?</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>Edit: I forgot to add the library included</strong> </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;unistd.h&gt;
  
  
  void create (char* program, char** arg_list)
  {
    /* put your code here */
    pid_t childPid;
    int status;
  
    if((childPid = fork()) &lt; 0){
      printf("Failed to fork() --- exiting...\n");
      exit(1);
    }
    else if (childPid == 0){ // --- inside the child process
      if(execvp(program, arg_list) &lt; 0){ // Failed to run the command
        printf("*** Failed to exec %s\n", program);
        exit(1);
      }
    }
    else{ // --- parent process
      while(wait(&amp;status) != childPid)
        printf("...\n");
    }
  }
  </code></pre>