Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select() on STDIN_FILENO problem

3 views
Skip to first unread message

Mark Swaanenburg

unread,
Dec 24, 2002, 8:49:05 AM12/24/02
to
Hi,

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


Basile STARYNKEVITCH

unread,
Dec 24, 2002, 10:31:41 AM12/24/02
to
>>>>> "Mark" == Mark Swaanenburg <spam0@@@eg.homeip.net> writes:

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

Kasper Dupont

unread,
Dec 24, 2002, 8:04:14 PM12/24/02
to

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?

0 new messages