wait.c 348 B

12345678910111213
  1. #include <syscall.h>
  2. #include <sys/types.h>
  3. #include <sys/wait.h>
  4. #include <sys/resource.h>
  5. /* Wait for a child to die. When one does, put its status in *STAT_LOC
  6. * and return its process ID. For errors, return (pid_t) -1. */
  7. __pid_t wait (__WAIT_STATUS_DEFN stat_loc)
  8. {
  9. return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
  10. }