date and time created 83/07/17 15:19:06 by edward
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Mon, 18 Jul 1983 06:19:06 +0000 (22:19 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Mon, 18 Jul 1983 06:19:06 +0000 (22:19 -0800)
SCCS-vsn: usr.bin/window/wwsuspend.c 1.1

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

diff --git a/usr/src/usr.bin/window/wwsuspend.c b/usr/src/usr.bin/window/wwsuspend.c
new file mode 100644 (file)
index 0000000..1717a6b
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef lint
+static char *sccsid = "@(#)wwsuspend.c 1.1 83/07/17";
+#endif
+
+#include "ww.h"
+#include <signal.h>
+
+#define mask(s)        (1<<(SIG/**/s-1))
+
+wwsuspend()
+{
+       int oldmask;
+
+       oldmask = sigblock(mask(TSTP));
+       wwend();
+       sigsetmask(sigblock(0) & ~mask(TSTP));
+       kill(0, SIGTSTP);
+       sigblock(mask(TSTP));
+       wwsettty(0, &wwnewtty);
+       Winit(2, 1);
+       sigsetmask(oldmask);
+}