diff options
author | mycroft <mycroft@NetBSD.org> | 1995-04-28 23:01:45 +0000 |
---|---|---|
committer | mycroft <mycroft@NetBSD.org> | 1995-04-28 23:01:45 +0000 |
commit | f15d2e466a0d6dc3ec30e9de57fbe8f0fce52621 (patch) | |
tree | d439be2f469f92d33b080176a7448e48355ac1b0 /hack/hack.ioctl.c | |
parent | 4bcf6f69bae8f6f73026d095d7f74903eda2c42c (diff) | |
download | bsdgames-darwin-f15d2e466a0d6dc3ec30e9de57fbe8f0fce52621.tar.gz bsdgames-darwin-f15d2e466a0d6dc3ec30e9de57fbe8f0fce52621.tar.zst bsdgames-darwin-f15d2e466a0d6dc3ec30e9de57fbe8f0fce52621.zip |
Use POSIX tty semantics.
Diffstat (limited to 'hack/hack.ioctl.c')
-rw-r--r-- | hack/hack.ioctl.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/hack/hack.ioctl.c b/hack/hack.ioctl.c index af62748f..fccd359f 100644 --- a/hack/hack.ioctl.c +++ b/hack/hack.ioctl.c @@ -3,37 +3,23 @@ */ #ifndef lint -static char rcsid[] = "$NetBSD: hack.ioctl.c,v 1.4 1995/03/23 08:30:29 cgd Exp $"; +static char rcsid[] = "$NetBSD: hack.ioctl.c,v 1.5 1995/04/28 23:01:45 mycroft Exp $"; #endif /* not lint */ /* This cannot be part of hack.tty.c (as it was earlier) since on some systems (e.g. MUNIX) the include files <termio.h> and <sgtty.h> define the same constants, and the C preprocessor complains. */ #include <stdio.h> +#include <termios.h> #include "config.h" -#ifdef BSD -#include <sgtty.h> -struct ltchars ltchars, ltchars0; -#else -#include <termio.h> /* also includes part of <sgtty.h> */ -struct termio termio; -#endif BSD +struct termios termios; getioctls() { -#ifdef BSD - (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) <chars); - (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars0); -#else - (void) ioctl(fileno(stdin), (int) TCGETA, &termio); -#endif BSD + (void) tcgetattr(fileno(stdin), &termios); } setioctls() { -#ifdef BSD - (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars); -#else - (void) ioctl(fileno(stdin), (int) TCSETA, &termio); -#endif BSD + (void) tcsetattr(fileno(stdin), TCSADRAIN, &termios); } #ifdef SUSPEND /* implies BSD */ |