select() on stdin and socket

Brian Fudge bfudge at netcom.COM
Mon Jun 3 07:03:42 AEST 1991


I am trying to use select() with stdin and a socket.  I can use fileno() to
get the file number for stdin and feed it to select.  Everything works fine,
but select() doesn't see input on stdin until I hit return.  I guess it is
being buffered line-by-line.  I tried using setvbuf() to change stdin to
character-at-a-time mode, but it didn't seem to work.  I've also tried various
combinations of "stty -icanon" and "stty -raw", but they don't process line
erase and backspace.  Is there any way to get select() to see input on stdin
before I hit return (so I can use fgets to get it)?

Thanks,
Brian Fudge
-- 
bfudge at netcom.com                                         thyss at cup.portal.com
"All my life I wanted to be someone... I can see now I should have been more
 specific."



More information about the Comp.unix.programmer mailing list