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