Dean Douthat <email@example.com> wrote:
I am trying to select on a number of devices for reading. Most are
serial ports but I also want to include keyboard so I add zero to both
the read and error sets. I am getting an immediate return from select
with the error “No error” on fd zero.
And is fd zero set for read in the bit field?
Is select not supported for stdin from keyboard? Or is there something
else I should be doing?
I think that you generally need a device to be in raw mode to be able
to select() on it. Terminal devices (like the console) don’t usually
default to this, so you may have to play with the tcsetattr() function
to change the mode of the terminal. If doing this, and your program
may exit, you will probably want to get the current state, save it
away, set you new state, then restore the original state on exit.
QNX Training Services