Nonblocking stdin on telnet

Till Straumann 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).

- T.

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);
>
> versus
>
>>  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,
> Andrei
>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20100707/1348a40a/attachment-0001.html>


More information about the users mailing list