xref: /original-bsd/usr.bin/window/wwsuspend.c (revision a64d8d4e)
1 /*
2  * Copyright (c) 1983 Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Edward Wang at The University of California, Berkeley.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #ifndef lint
12 static char sccsid[] = "@(#)wwsuspend.c	3.15 (Berkeley) 08/12/90";
13 #endif /* not lint */
14 
15 #include "ww.h"
16 #include "tt.h"
17 #include <sys/signal.h>
18 
19 void
20 wwsuspend()
21 {
22 	sig_t oldsig;
23 
24 	oldsig = signal(SIGTSTP, SIG_IGN);
25 	wwend();
26 	(void) signal(SIGTSTP, SIG_DFL);
27 	(void) kill(0, SIGTSTP);
28 	(void) signal(SIGTSTP, SIG_IGN);
29 	(void) wwsettty(0, &wwnewtty);
30 	xxstart();
31 	wwredraw();		/* XXX, clears the screen twice */
32 	(void) signal(SIGTSTP, oldsig);
33 }
34