sleepy@wybbs.mi.org (Mike Faber) (05/04/90)
I missed parts of this, but couldn't you use ioctl? Set yourself up as nonicanonical processing, and in the array struct.c_cc, set the VMIN element (struct.c_cc[VMIN]) to 0 and VTIME element to 1. Then a getchar() or getc() will return -1 if no characters were received. If you want to put it back, ungetc(or something like that) is supposed to work...