Is there a portable way to read data from stdin
without blocking, or to check if data is available to be read without blocking? Keep in mind stdin could be piped from another process, not just be terminal/keyboard input.
Best would be only using ANSI C function from stdlib.h or stdio.h, but using POSIX functions would be very portable too.
Also I'm not sure about this, but there are some forum posts where they say select()
wouldn't work on Windows in practice.