summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-05-27 02:12:20 +0000
committerJim Blandy <jimb@redhat.com>1993-05-27 02:12:20 +0000
commit50b8cf60325f92026d3fc768a433a5579c642df2 (patch)
tree5acda07c8407dd48778d61b146431508c9daf5eb
parent7ad1552990092f3c0301a2bb946bf368def41b08 (diff)
downloademacs-50b8cf60325f92026d3fc768a433a5579c642df2.tar.gz
emacs-50b8cf60325f92026d3fc768a433a5579c642df2.tar.bz2
emacs-50b8cf60325f92026d3fc768a433a5579c642df2.zip
* systty.h (HAVE_LTCHARS, HAVE_TCHARS): New macros; define them if
we have those structures, but *don't* define them if we have TERMIOS, whose functions take care of those parameters; that screws up AIX. (struct emacs_tty): Test those symbols, instead of the ioctl commands. * sysdep.c (emacs_get_tty, emacs_set_tty, new_ltchars, new_tchars, init_sys_modes): Same.
-rw-r--r--src/sysdep.c20
-rw-r--r--src/systty.h21
2 files changed, 29 insertions, 12 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 300ad654f1e..15a0da97190 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -765,13 +765,13 @@ emacs_get_tty (fd, settings)
#endif
/* Suivant - Do we have to get struct ltchars data? */
-#ifdef TIOCGLTC
+#ifdef HAVE_LTCHARS
if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0)
return -1;
#endif
/* How about a struct tchars and a wordful of lmode bits? */
-#ifdef TIOCGETC
+#ifdef HAVE_TCHARS
if (ioctl (fd, TIOCGETC, &settings->tchars) < 0
|| ioctl (fd, TIOCLGET, &settings->lmode) < 0)
return -1;
@@ -846,13 +846,13 @@ emacs_set_tty (fd, settings, waitp)
#endif
/* Suivant - Do we have to get struct ltchars data? */
-#ifdef TIOCGLTC
+#ifdef HAVE_LTCHARS
if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0)
return -1;
#endif
/* How about a struct tchars and a wordful of lmode bits? */
-#ifdef TIOCGETC
+#ifdef HAVE_TCHARS
if (ioctl (fd, TIOCSETC, &settings->tchars) < 0
|| ioctl (fd, TIOCLSET, &settings->lmode) < 0)
return -1;
@@ -888,10 +888,10 @@ unsigned char _sobuf[BUFSIZ+8];
char _sobuf[BUFSIZ];
#endif
-#ifdef TIOCGLTC
+#ifdef HAVE_LTCHARS
static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
#endif
-#ifdef TIOCGETC
+#ifdef HAVE_TCHARS
static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
#endif
@@ -1042,7 +1042,7 @@ init_sys_modes ()
control for user coming over network on 4.2; in this case,
only t_stopc and t_startc really matter. */
#ifndef HAVE_TERMIO
-#ifdef TIOCGETC
+#ifdef HAVE_TCHARS
/* Note: if not using CBREAK mode, it makes no difference how we
set this */
tty.tchars = new_tchars;
@@ -1068,12 +1068,12 @@ init_sys_modes ()
lmode = tty.lmode;
#endif
-#endif /* TIOCGETC */
+#endif /* HAVE_TCHARS */
#endif /* not HAVE_TERMIO */
-#ifdef TIOCGLTC
+#ifdef HAVE_LTCHARS
tty.ltchars = new_ltchars;
-#endif /* TIOCGLTC */
+#endif /* HAVE_LTCHARS */
EMACS_SET_TTY (input_fd, &tty, 0);
diff --git a/src/systty.h b/src/systty.h
index 98e97960540..d4a77d2847f 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -157,6 +157,17 @@ static struct sensemode {
#undef SIGIO
#endif
+/* On TERMIOS systems, the tcmumbleattr calls take care of these
+ parameters, and it's a bad idea to use them (on AIX, it makes the
+ tty hang for a long time).
+#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS)
+#define HAVE_LTCHARS
+#endif
+
+#if defined (TIOCGETC) && !defined (HAVE_TERMIOS)
+#define HAVE_TCHARS
+#endif
+
/* Try to establish the correct character to disable terminal functions
in a system-independent manner. Note that USG (at least) define
@@ -286,13 +297,19 @@ struct emacs_tty {
#endif
#endif
#endif
-#ifdef TIOCGLTC
+
+/* If we have TERMIOS, we don't need to do this - they're taken care of
+ by the tc*attr calls. */
+#ifndef HAVE_TERMIOS
+#ifdef HAVE_LTCHARS
struct ltchars ltchars;
#endif
-#ifdef TIOCGETC
+
+#ifdef HAVE_TCHARS
struct tchars tchars;
int lmode;
#endif
+#endif
};
/* Define EMACS_GET_TTY and EMACS_SET_TTY,