Commit 50b8cf60 authored by Jim Blandy's avatar Jim Blandy

* 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.
parent 7ad15529
......@@ -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);
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment