tcsh: fix warning to keep compiling with WARNS=2
[dragonfly.git] / games / hack / hack.ioctl.c
blob7c9aa90ade9da5dd909359c9b73400d6188cd53b
1 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2 /* hack.ioctl.c - version 1.0.2 */
3 /* $FreeBSD: src/games/hack/hack.ioctl.c,v 1.2 1999/09/12 07:01:23 marcel Exp $
4 $DragonFly: src/games/hack/hack.ioctl.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $
6 This cannot be part of hack.tty.c (as it was earlier) since on some
7 systems (e.g. MUNIX) the include files <termio.h> and <sgtty.h>
8 define the same constants, and the C preprocessor complains. */
9 #include "hack.h"
10 #include <termios.h>
11 struct termios termio;
13 void
14 getioctls(void)
16 tcgetattr(fileno(stdin), &termio);
19 void
20 setioctls(void)
22 tcsetattr(fileno(stdin), TCSANOW, &termio);
25 #ifdef SUSPEND
26 #include <signal.h>
27 int
28 dosuspend(void)
30 #ifdef SIGTSTP
31 if(signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
32 settty(NULL);
33 signal(SIGTSTP, SIG_DFL);
34 kill(0, SIGTSTP);
35 gettty();
36 setftty();
37 docrt();
38 } else {
39 pline("I don't think your shell has job control.");
41 #else /* SIGTSTP */
42 pline("Sorry, it seems we have no SIGTSTP here. Try ! or S.");
43 #endif /* SIGTSTP */
44 return(0);
46 #endif /* SUSPEND */