summaryrefslogtreecommitdiff
path: root/games/bsdgames/files/patch-hack_hack.ioctl.c
blob: cd899364bed074dcce657ec6967e72c3b2991b79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Index: hack/hack.ioctl.c
@@ -13,6 +13,9 @@
 #ifdef BSD
 #include	<sgtty.h>
 struct ltchars ltchars, ltchars0;
+#elif POSIX
+#include 	<termios.h>
+struct termios termio;
 #else
 #include	<termio.h>	/* also includes part of <sgtty.h> */
 struct termio termio;
@@ -22,6 +25,8 @@
 #ifdef BSD
 	(void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) &ltchars);
 	(void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars0);
+#elif POSIX
+	tcgetattr(fileno(stdin), &termio);
 #else
 	(void) ioctl(fileno(stdin), (int) TCGETA, &termio);
 #endif /* BSD */
@@ -30,6 +35,8 @@
 setioctls() {
 #ifdef BSD
 	(void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars);
+#elif POSIX
+	tcsetattr(fileno(stdin), TCSANOW, &termio);
 #else
 	(void) ioctl(fileno(stdin), (int) TCSETA, &termio);
 #endif /* BSD */