select question

Jerry LeVan MATLEVAN at EKU
Mon Dec 3 03:05:00 AEST 1990


Hello,

I have been playing with Doug Tody's nifty cu replacement program
"modem.c" and have run into a small problem.

The program does a "select" on the modem line and the tty (with
a small timeout value). When the returned read mask indicates that
I/O is possible a one character read is posted to the tty to pick
up a keystroke for processing and transmission to the modem line.

The program works well except when I talk to a nearby VMS system
and am using the eve editor. I am using the command shell that has
the vt100 keypad.

It appears that when I strike a key that sends an escape sequence
that only the <esc> character is initially sent and the other characters
are buffered until another keypress.

The terminal settings are set as:
        tty = o_tty; /* the old settings */
        tty.c_iflag &= ~(INLCR|ICRNL|ISTRIP|BRKINT);
        tty.c_oflag &= ~OPOST;
        tty.c_lflag &= ~(ICANON|ISIG|ECHO)
        tty.c_cc[4]=0;
        tty.c_cc[5]=0;

Question:
        Wait: select(...)
              if (rflag) read one character; process character
              goto wait
If I am at Wait: and place <esc>Or into the system,(down arrow).
the select fires once the <esc> is processed. When the code returns
to the Wait: select(...) the read flag is *not* set again even though
the "O and "r" are available.

What do I not understand about select or the terminal driver?

Jerry
-----------------------------------------------------------------------------
| Jerry LeVan                           | Phone:(606)-622-1931              |
| Department of Computer Science        |                                   |
| Eastern Kentucky University           | Email:matlevan at eku.bitnet         |
| Richmond Ky 40475                     |                                   |
|---------------------------------------------------------------------------|
|      "The series converges so slowly that it actually diverges."          |
-----------------------------------------------------------------------------



More information about the Comp.unix.aux mailing list