waitpid.c 453 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * ngIRCd -- The Next Generation IRC Daemon
  3. */
  4. #include "portab.h"
  5. /**
  6. * @file
  7. * waitpid() implementation. Public domain.
  8. * Written by Steven D. Blackford for the NeXT system.
  9. */
  10. #ifndef HAVE_WAITPID
  11. #include <string.h>
  12. #include <stdlib.h>
  13. #include <sys/types.h>
  14. GLOBAL int
  15. waitpid(pid, stat_loc, options)
  16. int pid, *stat_loc, options;
  17. {
  18. for (;;) {
  19. int wpid = wait(stat_loc);
  20. if (wpid == pid || wpid == -1)
  21. return wpid;
  22. }
  23. }
  24. #endif