HELP: Low level terminal I/O

Misha Pavel mis at APL.STANFORD.EDU
Fri Jul 21 08:54:52 AEST 1989


I have a problem that probably reflects more my
understanding of the low-level I/O than its inherent difficulty,
but I am not shure how to proceed.

I need to  read a tty line and return  immediately 
even if there is nothing  in the system buffer for that tty.
To do that I set the terminal in raw mode with the folowing
settings:

  term.c_iflag = IGNBRK;
  term.c_oflag = 0;
  term.c_lflag = 0;
  term.c_cflag = B9600 | CS8 | CREAD | PARENB | PARODD;
  term.c_cc[VMIN] = 1;
  term.c_cc[VTIME] = 0;

I was hoping that the term.c_cc[VTIME] = 0 would do the job.
But the system seems to  be still waiting for at least one char.

Is there any way to look at the system buffer and or return
from read() when no input was generated?

(Because of the real-time application I cannot afford to
run a separate terminal process on my IRIS-2400).

Any ideas?

Thanks in advance

Misha Pavel <mis at psych.Stanford.Edu>



More information about the Comp.sys.sgi mailing list