waitpid.c 476 B

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