Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!chinet!clif From: clif@chinet.UUCP (Clif Flynt) Newsgroups: comp.unix.xenix Subject: termio under SCO Xenix Message-ID: <2113@chinet.UUCP> Date: 14 Jan 88 20:18:07 GMT Reply-To: clif@chinet.UUCP (Clif Flynt) Organization: Chinet - Public Access Unix Lines: 39 This is either a bug in my understanding of termio, or a bug in SCO's implementation. I'd be happy to hear either confirmed, since I've found a workaround. The situation is that I need to watch keystrokes coming in from console, and distinguish the difference between a function key ( ' [ G' for example) and an escape. My thought was that I'd set the VMIN and VTIME parameters in termio, turn off ICANON, and if I timed out, then I'd recieved a bare escape, not the start of a function key. So, I tried: nterm.c_cc[VMIN] = 1; nterm.c_cc[VTIME] = 2; nterm.c_lflag &= !ICANON; ioctl... My understanding is that a read will return when it recieved VMIN char's (one character) or it times out after .2 seconds. The reads never timed out, though I did get each character typed as soon as the key was pressed. When I changed VMIN to 0, I got the behavior I expected to see, with timeouts happenning after .2 seconds. The read returns 0 for a count of characters read if timeout, and 1 if it reads a char. So, my question is, why didn't I time out when VMIN was > 0? Should I time out, (is this a bug) or should VMIN take precedence over VTIME (an error in my comprehension). Thanks for any info folks supply. -- ------------------------------------------------------------------------ My Opinions are my own. I can't imagine why anyone else would want them. Clif Flynt ihnp4!chinet!clif ------------------------------------------------------------------------