Questions about TCSETA[WF] ioctls (System V)
John Temples
john at jwt.UUCP
Wed Jun 12 07:37:25 AEST 1991
I have an application which sets up the tty with VMIN=0 and
periodically checks the keyboard for input by looking for a non-zero
return value from read(). Upon receipt of a keystroke, one of two
things happens: a screenful of data is displayed, or the tty is
switched to VMIN=1 and a few characters of input are read from the
user.
Initially, I was using TCSETAW to switch to VMIN=1. Users experienced
problems with the console locking up when doing something like
<key that produces output>
<another key that produces output before the last one finishes>
<Control-S>
It took an interrupt character to unlock the keyboard. It appeared as
though the lockup was occurring within the TCSETAW ioctl. So I changed
it to a TCSETA ioctl, thinking this would eliminate the lockup, since I
was taking away the "wait" portion of the ioctl. Sure enough, the
lockup went away, but a new problem appeared. Sometimes when a user
pressed a key which required further input, they would see the first one or
two prompts go by, as though they had pressed return at those. It
appeared as though there was some lag in getting the tty into VMIN=1
mode. Can anyone shed some light on how these ioctls work, or point me
to a reference which is more in-depth than the four sentences on the
termio(7) man page?
--
John W. Temples -- john at jwt.UUCP (uunet!jwt!john)
More information about the Comp.unix.programmer
mailing list