1 2 3 4 5 6 7 8 9 10 11
int waitpid (pid, stat_loc, options) int pid, *stat_loc, options; { for (;;) { int wpid = wait(stat_loc); if (wpid == pid || wpid == -1) return wpid; } }