wait.c 420 B

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