diff options
author | miwi <miwi@FreeBSD.org> | 2008-05-16 22:10:38 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2008-05-16 22:10:38 +0800 |
commit | c1e1e28d78ff6749a964b0a36c6beca022ad0d72 (patch) | |
tree | 3b24aaa8966453b62fc2197b0cf958ab7da276fa /emulators | |
parent | e79f6a5274f5f639256347afdaa88b677ba274ef (diff) | |
download | freebsd-ports-gnome-c1e1e28d78ff6749a964b0a36c6beca022ad0d72.tar.gz freebsd-ports-gnome-c1e1e28d78ff6749a964b0a36c6beca022ad0d72.tar.zst freebsd-ports-gnome-c1e1e28d78ff6749a964b0a36c6beca022ad0d72.zip |
- The emulators/dlx port is one of the last remaining ports that uses
sgtty exclusively. We'd better port it to termios, to make it work
without the COMPAT_43TTY kernel switch.
PR: 122884
Submitted by: Ed Schouten <ed@80386.nl>
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/dlx/files/patch-io-termios | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/emulators/dlx/files/patch-io-termios b/emulators/dlx/files/patch-io-termios new file mode 100644 index 000000000000..c9a268944ee1 --- /dev/null +++ b/emulators/dlx/files/patch-io-termios @@ -0,0 +1,65 @@ +--- dlxsim/io.c ++++ dlxsim/io.c +@@ -18,6 +18,8 @@ + static char rcsid[] = "$Header: /user1/ouster/mipsim/RCS/io.c,v 1.3 89/12/07 18:00:21 ouster Exp $ SPRITE (Berkeley)"; + #endif /* not lint */ + ++#include <sys/ioctl.h> ++ + #include <ctype.h> + #include <stdio.h> + #include <fcntl.h> +@@ -283,17 +285,19 @@ + register DLX *machPtr; /* Machine being simulated. */ + { + int flags; ++ struct termios newState; + + /* + * Save terminal state, and put it into a raw-er mode during + * the simulation. + */ + +- ioctl(0, TIOCGETP, (char *) &(machPtr->ioState.savedState)); +- flags = machPtr->ioState.savedState.sg_flags; +- machPtr->ioState.savedState.sg_flags = (flags | CBREAK) & ~ECHO; +- ioctl(0, TIOCSETP, (char *) &machPtr->ioState.savedState); +- machPtr->ioState.savedState.sg_flags = flags; ++ tcgetattr(0, &newState); ++ machPtr->ioState.savedState = newState; ++ newState.c_lflag &= ~(ICANON|ECHO); ++ newState.c_cc[VMIN] = 0; ++ newState.c_cc[VTIME] = 0; ++ tcsetattr(0, TCSANOW, &newState); + } + + /* +@@ -325,7 +329,7 @@ + */ + + CheckInput(machPtr); +- ioctl(0, TIOCSETP, (char *) &machPtr->ioState.savedState); ++ tcsetattr(0, TCSANOW, &machPtr->ioState.savedState); + } + + /* +--- dlxsim/io.h ++++ dlxsim/io.h +@@ -19,7 +19,7 @@ + #ifndef _MIPSIM_IO + #define _MIPSIM_IO + +-#include <sgtty.h> ++#include <termios.h> + + /* + * The following structure is part of each DLX machine, and describes +@@ -27,7 +27,7 @@ + */ + + typedef struct IoState { +- struct sgttyb savedState; /* Used to save original terminal state ++ struct termios savedState; /* Used to save original terminal state + * so terminal can be put into CBREAK + * mode during simulation and then be + * restored when simulation stops. */ |