wait.c 403 B

12345678910111213
  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 __libc_wait (__WAIT_STATUS_DEFN stat_loc)
  9. {
  10. return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
  11. }
  12. weak_alias(__libc_wait, wait)