Skip to content
Advertisement

Tag: polling

Nonblocking Get Character

Platform: Linux 3.2.0 x86 (Debian 7) Compiler: GCC 4.7.2 (Debian 4.7.2-5) I am writing a function that reads a single character from stdin if a character is already present in stdin. If stdin is empty the function is suppose to do nothing and return -1. I googled nonblocking input and was pointed to poll() or select(). First I tried to

Advertisement