Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!ncar!gatech!udel!princeton!pucc!AUXPOST From: MATLEVAN@EKU (Jerry LeVan) Newsgroups: comp.unix.aux Subject: select question Message-ID: Date: 2 Dec 90 16:05:00 GMT Sender: VMNNPOST@pucc.Princeton.EDU (Listserv to Netnews Gateway) Organization: Listserv to Netnews Gateway at pucc.Princeton.EDU Lines: 46 Approved: AUXPOST@PUCC 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 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 Or into the system,(down arrow). the select fires once the 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@eku.bitnet | | Richmond Ky 40475 | | |---------------------------------------------------------------------------| | "The series converges so slowly that it actually diverges." | -----------------------------------------------------------------------------