version 1.12, 1997/08/05 04:00:00 |
version 1.13, 1997/08/31 14:32:14 |
|
|
int pid; |
int pid; |
char done; |
char done; |
char free; |
char free; |
union wait status; |
int status; |
struct child *link; |
struct child *link; |
}; |
}; |
static struct child *child; |
static struct child *child; |
|
|
int signo; |
int signo; |
{ |
{ |
int pid; |
int pid; |
union wait status; |
int status; |
register struct child *cp; |
register struct child *cp; |
int save_errno = errno; |
int save_errno = errno; |
|
|
while ((pid = |
while ((pid = |
wait3((int *)&status, WNOHANG, (struct rusage *)0)) > 0) { |
waitpid((pid_t)-1, &status, WNOHANG)) > 0) { |
cp = findchild(pid); |
cp = findchild(pid); |
if (cp->free) |
if (cp->free) |
delchild(cp); |
delchild(cp); |
|
|
errno = save_errno; |
errno = save_errno; |
} |
} |
|
|
union wait wait_status; |
int wait_status; |
|
|
/* |
/* |
* Wait for a specific child to die. |
* Wait for a specific child to die. |
|
|
wait_status = cp->status; |
wait_status = cp->status; |
delchild(cp); |
delchild(cp); |
sigprocmask(SIG_SETMASK, &oset, NULL); |
sigprocmask(SIG_SETMASK, &oset, NULL); |
return(wait_status.w_status ? -1 : 0); |
return((WIFEXITED(wait_status) && WEXITSTATUS(wait_status)) ? -1 : 0); |
} |
} |
|
|
/* |
/* |