From: Fred Roy <froy@gr.osf.org>
Subject: Re: problems with full-screen based programs
Date: Tue, 10 Sep 1996 12:06:58 +0200 [thread overview]
Message-ID: <199609100959.FAA18737@postman.osf.org> (raw)
In-Reply-To: <199609100517.AA10673@dorsai.dorsai.org>
You --tony@dorsai.org-- recently wrote:
>Just about everything is working great on my UDB, _except_ some
>of the full-screen based programs. I'm using RedHat 3.0.3 with all the
>ECOFF .rpm's. (Don't have the time to ELF my system right now)
>
> Things like "elm", "tin", and "irc" have this REALLY annoying
>I/O buffering problem. It seems that it takes several characters of
>input (a lot of returns, etc.) in order to get response out of any of
>the programs.
>
>I don't suspect it's a termcap problem, because other things like
>"vi" and "lynx" work fine, but the others are broken. I'm not sure if "lynx"
>uses the curses libraries (if I remember, it has options for both curses and
>non-curses) so my inital *GUESS* is that it might be curses.
Some months ago, I encountered the same problems with "more"; I had used as
source code for "more" the Slackware Linux/Intel 1.x source code distribution,
and had built it on a DEC Alpha system running the "old" Linux/Alpha
distribution termed "BLADE 0.3", including an "old" libc. Here are things
discussed on these topics:
* Date: Fri, 16 Feb 1996 08:46:12 -0700
* From: David Mosberger-Tang <davidm@AZStarNet.com>
* Subject: Re: midi player? & more
* > I first added lines like:
* > otty.c_lflag &= ~(ICANON|ECHO);
* > + otty.c_cc[VMIN] = 1; /* be sure it is 1 */
* > + otty.c_cc[VTIME] = 0; /* be sure it is 0 */
* > without success.
* This one fixes more in util-linux-2.5 as well. I suspect it shouldn't
* be necessary. It starts to look to me like TCGETA may not return the
* correct values. Looking at linux/include/asm-alpha/termios.h, we find
* that trans_to_termio() sets the _VMIN and _VTIME entries *only* if the
* ICANON flag is set in c_lflag whereas the x86 version always copies
* everything unconditionally.
* > Then I noticed that ioctl() was called with (sometimes) a pointer to a
* > `struct termio' as 3rd argument, while (on Linux/Alpha/BLADE_0.3)
* > the Vxx array indexes differed beetween termio.c_cc[] and termios.c_cc[]
* > ... and in system headers VMIN * & co are overriden to suit the
* > `struct termio' variants only when <termio.h> is included ... and it's
* > not the case in more.c.
* termio and termios are not compatible on Linux/Alpha (in fact, you get
* an error message when trying to include both header files). As long
* as one sticks with one or the other, everything will (should) work
* fine though. So the real bug may have been that the old more.c
* included termios.h when it should have included termio.h (this is
* correct in the version distributed by Red Hat).
- - - - - -
* Subject: Re: Re: midi player? & more
* Date: Fri, 16 Feb 96 17:21:10 +0100
* From: Fred Roy <froy@gr.osf.org>
*
* The hidden thing that I have forgot to mention is: in BLADE_0.3 (sorry...)
* <sys/ioctl.h> includes <termios.h> ... so without changing the headers
* one could not *also* include <termio.h> in util-linux-2.1/more.c to get
* in the redefinitions of VMIN to _VMIN, etc. Don't know if it also
* applies to util-linux-2.5/more.c. ... and RedHat's <sys/ioctl.h>.
- - - - - -
* Date: Fri, 16 Feb 1996 09:30:35 -0700
* From: David Mosberger-Tang <davidm@AZStarNet.com>
* Subject: Re: Re: midi player? & more
* The more in Red Hat does not include sys/ioctl.h. But it's a mess
* anyways. I'm not going to be able to look into this soon (I'm having
* plenty fun with glibc already), but if somebody could track this down
* (e.g., *why* are termio and termios incompatible? what does OSF/1
* do? etc) it surely looks like something that should go into 2.0.
* The reason I'm pushing glibc (besides being good in itself) is that
* it will require a few kernel changes as well---needless to say, 2.0
* sounds like a target for these...
- - - - - -
* Date: Fri, 16 Feb 1996 11:29:39 -0500 (EST)
* From: Erik Troan <ewt@redhat.com>
* Subject: Re: Re: midi player? & more
*
* On Fri, 16 Feb 1996, Fred Roy wrote:
* > The hidden thing that I have forgot to mention is: in BLADE_0.3 (sorry...)
* > <sys/ioctl.h> includes <termios.h> ... so without changing the headers
* > one could not *also* include <termio.h> in util-linux-2.1/more.c to get
* > in the redefinitions of VMIN to _VMIN, etc. Don't know if it also
* > applies to util-linux-2.5/more.c. ... and RedHat's <sys/ioctl.h>.
*
* I don't mess with any of that stuff.
- - - - - -
* Date: Sat, 17 Feb 1996 17:22:32 -0700
* From: David Mosberger-Tang <davidm@AZStarNet.com>
*
* OK, here is the scoop:
*
* The OSF/1 (and System V?) version of termio interprets termio.c_cc[4]
* and termio.c_cc[5] as VEOF and VEOL if ICANON is set in
* termio.c_lflag. If ICANON is not set, those fields are interpreted as
* VMIN and VTIME, respectively. What more does is get the current
* termio structure, turn off ICANON (as well as making some other
* changes), and then it sets the new termio structure. Since the old
* structure was gotten with ICANON set, the values in termio.c_cc[4]/[5]
* are the VEOF and VEOL values but when they are set, they are
* interpreted as VMIN and VTIME... So it really is necessary to set
* VMIN and VTIME in more---it's not a kernel problem (but it sure is
* ugly...).
*
* I guess the solution is to encourage everyone to use termios (that's
* why less is more... :-)
Summary: when using early (1995) versions of Linux/Alpha system headers and
libc, there were terminal I/O buffering problems in the AXP executable
obtained for classic Linux commands relying on the old-styled "termio" API,
such as the "more" command.
I made changes both in system headers and the source code for "more"
--"ispell" is perhaps another example-- to fix such problems.
I can't say if the problem you recently encountered with "elm" is the same or
not: while I built a working "elm" on Linux/Alpha, I have no longer my source
code on-line. As far as I remember, for commands relying on the "curses" API,
I used the "ncurses" Linux/Alpha library variant instead of the "curses"
variant. However, I don't know if these two variants are supported in today
RedHat distributions for Linux/Alpha.
Note: the Elvis "vi" clone uses a custom version of "curses" that is embedded
within the source code for this command. This could explain why "vi" works
while "elm" does not.
fred
--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null
next parent reply other threads:[~1996-09-10 10:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199609100517.AA10673@dorsai.dorsai.org>
1996-09-10 10:06 ` Fred Roy [this message]
1996-09-10 15:09 ` problems with full-screen based programs Michal Jaegermann
1996-09-10 6:39 David Mosberger-Tang
1996-09-10 16:02 ` Tony Tonns
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox