date and time created 83/08/09 18:37:52 by edward
[unix-history] / usr / src / usr.bin / window / wwchild.c
... / ...
CommitLineData
1#ifndef lint
2static char *sccsid = "@(#)wwchild.c 2.1.1.1 83/08/09";
3#endif
4
5#include "ww.h"
6#include <sys/wait.h>
7
8wwchild()
9{
10 register struct ww **wp;
11 union wait w;
12 int pid;
13
14 while ((pid = wait3(&w, WNOHANG|WUNTRACED, (struct rusage *)0)) > 0) {
15 for (wp = wwindex; wp < &wwindex[NWW]; wp++) {
16 if (*wp && (*wp)->ww_state == WWS_HASPROC
17 && (*wp)->ww_pid == pid) {
18 (*wp)->ww_state = WWS_DEAD;
19 /*
20 (void) wwprintf(curwin,
21 "\r\n%d: Died\r\n", pid);
22 */
23 break;
24 }
25 }
26 /*
27 if (wp >= &wwindex[NWW])
28 (void) wwprintf(curwin, "\r\n%d: No such child\r\n", pid);
29 */
30 }
31}