non-blocking read

John A. Limpert johnl at proper.UUCP
Sat Feb 4 01:14:22 AEST 1984


Is there any clean way for a program to determine whether or not the
user has typed a character on the keyboard without blocking the
program?  The only scheme I have been able to come up with is to fork
another process that reads characters from the tty and writes them
into a file.  The main process could then check the size of the file
to determine if there were any new characters to process.  I know
that the kernel I/O drivers have this information, is there any way
of getting it without spying on some magic location in /dev/kmem?



More information about the Comp.unix mailing list