date and time created 83/07/12 17:20:39 by edward
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 13 Jul 1983 08:20:39 +0000 (00:20 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Wed, 13 Jul 1983 08:20:39 +0000 (00:20 -0800)
SCCS-vsn: usr.bin/window/wwchild.c 1.1

usr/src/usr.bin/window/wwchild.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/window/wwchild.c b/usr/src/usr.bin/window/wwchild.c
new file mode 100644 (file)
index 0000000..eb8211f
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef lint
+static char *sccsid = "@(#)wwchild.c   1.1 83/07/12";
+#endif
+
+#include "ww.h"
+#include <sys/wait.h>
+
+wwchild()
+{
+       register struct ww *wp;
+       union wait w;
+       int pid;
+       /*
+       char buf[100];
+       */
+
+       while ((pid = wait3(&w, WNOHANG|WUNTRACED, 0)) > 0) {
+               for (wp = _wwhead; wp; wp = wp->ww_next) {
+                       if (wp->ww_pid == pid) {
+                               wp->ww_state = WW_DEAD;
+                               /*
+                               (void) sprintf(buf, "\r\n%d: Died\r\n", pid);
+                               wwputstr(buf);
+                               */
+                               break;
+                       }
+               }
+               /*
+               if (wp == 0) {
+                       (void) sprintf(buf, "\r\n%d: No such child\r\n", pid);
+                       wwputstr(buf);
+               }
+               */
+       }
+}