home *** CD-ROM | disk | FTP | other *** search
- # include <signal.h>
-
- # include "curses.ext"
-
- /*
- * handle stop and start signals
- *
- * 6/25/83 (Berkeley) @(#)tstp.c 1.3
- */
- tstp() {
-
- # ifdef SIGTSTP
-
- int ttyflags;
- int omask;
- # ifdef DEBUG
- if (outf)
- fflush(outf);
- # endif
- ttyflags = _tty.sg_flags; /* store curses state */
- mvcur(0, COLS - 1, LINES - 1, 0);
- endwin();
- fflush(stdout);
- /* reset signal handler so kill below stops us */
- signal(SIGTSTP, SIG_DFL);
- #define mask(s) (1 << ((s)-1))
- omask = sigsetmask(sigblock(0) &~ mask(SIGTSTP));
- kill(0, SIGTSTP);
- /* pc stops here */
- /* okay, we started up again. */
- sigsetmask(omask);
- signal(SIGTSTP, tstp);
- savetty(); /* re-remember the virgin state */
- _tty.sg_flags = ttyflags; /* restore special curses state */
- ioctl(_tty_ch, TIOCSETN, &_tty);
- _puts(TI); /* should we do VS too? */
- wrefresh(curscr);
- # endif SIGTSTP
- }
-