Commit | Line | Data |
---|---|---|
bfbd46c7 | 1 | #ifndef lint |
e908bfac | 2 | static char *sccsid = "@(#)wwsuspend.c 3.2 83/08/15"; |
bfbd46c7 EW |
3 | #endif |
4 | ||
5 | #include "ww.h" | |
e908bfac | 6 | #include "tt.h" |
bfbd46c7 EW |
7 | #include <signal.h> |
8 | ||
96f35979 | 9 | #define mask(s) (1 << (s) - 1) |
bfbd46c7 EW |
10 | |
11 | wwsuspend() | |
12 | { | |
13 | int oldmask; | |
14 | ||
96f35979 | 15 | oldmask = sigblock(mask(SIGTSTP)); |
bfbd46c7 | 16 | wwend(); |
96f35979 EW |
17 | (void) sigsetmask(sigblock(0) & ~mask(SIGTSTP)); |
18 | (void) kill(0, SIGTSTP); | |
19 | (void) sigblock(mask(SIGTSTP)); | |
20 | (void) wwsettty(0, &wwnewtty); | |
e908bfac | 21 | (*tt.tt_init)(); |
96f35979 EW |
22 | wwredraw(); |
23 | (void) sigsetmask(oldmask); | |
bfbd46c7 | 24 | } |