Nonblocking stdin on telnet
strauman at slac.stanford.edu
Thu Jul 8 01:17:35 UTC 2010
Just some background info:
fileno 0 is the file descriptor of the console which is a global
entity like all file descriptors. The telnetd allocates a PTY (which
gets assigned a new, global file descriptor) for your session and
opens FILE streams on the PTY.
Therefore and unlike in a multi-processing unix environment fileno(stdin)
is not necessarily 0 (even w/o any explicit redirection).
On 07/07/2010 10:57 AM, Andrei Chichak wrote:
> Well that was interesting. What I had almost worked. The difference was:
> tcsetattr (STDIN_FILENO, TCSANOW, &newt);
>> int fd = fileno(in);
>> tcsetattr(fd, TCSANOW, &newt);
> STDIN_FILENO has a value of 0, whereas fileno(stdin) has a value of 9.
> Thanks for all your help,
> rtems-users mailing list
> rtems-users at rtems.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users