I probably have a very simple problem. I just can't find the solution. The
problem is that when I do a select() on the stdin fd, it only works when I
hit enter. This is probably caused by some cashing which is done on the
input. I guess I can probably change this setting with an ioctl(), but I
cannot find which ioctl.
Any help would be appreciated...
Thanks,
Mark
Mark> Hi, I probably have a very simple problem. I just can't find
Mark> the solution. The problem is that when I do a select() on
Mark> the stdin fd, it only works when I hit enter. This is
Mark> probably caused by some cashing which is done on the
Mark> input. I guess I can probably change this setting with an
Mark> ioctl(), but I cannot find which ioctl.
This is not because there is some caching on stdin, but because stdin
is usually a [pseudo]terminal with its own line discipline.
There are some ioctl to change the line discipline of a terminal, but
remember that any such changes affect the terminal itself (and not
only the file descriptor in your process), this means that any such
change will be permanent, even for your parent shell process (unless
you undo it explicitly).
A google search gives you many links including
http://www.pwilson.net/kbhit.html
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net
alias: basile<at>tunes<dot>org
8, rue de la Faïencerie, 92340 Bourg La Reine, France
Does this help?
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#termios
--
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaa...@daimi.au.dk
Hvem er fjenden i Aalborg?