wait.c 368 B

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