8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / ucblib / libcurses / tstp.c
blob8d51173cea9e035d0be3039a2a00a30a6ef02156
1 /*
2 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
9 /*
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 #ifndef lint
18 static char
19 sccsid[] = "@(#)tstp.c 1.6 88/02/08 SMI"; /* from UCB 5.1 85/06/07 */
20 #endif /* not lint */
22 #include <sys/types.h>
23 #include <signal.h>
24 #include "curses.ext"
25 #include <sgtty.h>
28 * handle stop and start signals
30 * @(#)tstp.c 5.1 (Berkeley) 6/7/85
33 void
34 tstp(void)
36 #ifdef SIGTSTP
38 SGTTY tty;
39 #ifdef DEBUG
40 if (outf)
41 (void) fflush(outf);
42 #endif
43 tty = _tty;
44 (void) mvcur(0, COLS - 1, LINES - 1, 0);
45 (void) endwin();
46 (void) fflush(stdout);
47 /* reset signal handler so kill below stops us */
48 (void) signal(SIGTSTP, SIG_DFL);
49 (void) sigsetmask(sigblock(0) &~ sigmask(SIGTSTP));
50 (void) kill(0, SIGTSTP);
51 (void) sigblock(sigmask(SIGTSTP));
52 (void) signal(SIGTSTP, (void(*)(int))tstp);
53 _tty = tty;
54 (void) stty(_tty_ch, &_tty);
55 (void) wrefresh(curscr);
56 #endif /* SIGTSTP */