waitpid.c 662 B

123456789101112131415161718192021
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Copyright (C) 2006 Steven J. Hill <sjhill@realitydiluted.com>
  4. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/wait.h>
  9. #include <cancel.h>
  10. pid_t __NC(waitpid)(pid_t pid, int *wait_stat, int options)
  11. {
  12. #if 1 /* kernel/exit.c says to avoid waitpid syscall */
  13. return __wait4_nocancel(pid, wait_stat, options, NULL);
  14. #else
  15. return INLINE_SYSCALL(waitpid, 3, pid, wait_stat, options);
  16. #endif
  17. }
  18. CANCELLABLE_SYSCALL(pid_t, waitpid, (pid_t pid, int *wait_stat, int options), (pid, wait_stat, options))
  19. lt_libc_hidden(waitpid)