<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Just some background info:<br>
<br>
fileno 0 is the file descriptor of the console which is a global<br>
entity like all file descriptors. The telnetd allocates a PTY (which<br>
gets assigned a new, global file descriptor) for your session and<br>
opens FILE streams on the PTY.<br>
Therefore and unlike in a multi-processing unix environment
fileno(stdin)<br>
is not necessarily 0 (even w/o any explicit redirection).<br>
<br>
- T.<br>
<br>
On 07/07/2010 10:57 AM, Andrei Chichak wrote:
<blockquote cite="mid:A570F19C-F5F9-427B-8993-F3E35875ACF5@chichak.ca"
type="cite">Well that was interesting. What I had almost worked. The
difference was:
<div><br>
</div>
<div><span class="Apple-style-span"
style="font-family: Monaco; font-size: 10px;"><span
style="color: rgb(130, 42, 148);">tcsetattr</span></span><span
class="Apple-style-span" style="font-family: Monaco; font-size: 10px;"> </span><span
class="Apple-style-span" style="font-family: Monaco; font-size: 10px;">(STDIN_FILENO,
TCSANOW, &newt);</span><br>
<div>
<div><br>
</div>
<div>versus</div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div> int fd = fileno(in);<br>
</div>
</blockquote>
<blockquote type="cite">
<div> tcsetattr(fd, TCSANOW, &newt); <br>
</div>
</blockquote>
<br>
</div>
<div><br>
</div>
<div>STDIN_FILENO has a value of 0, whereas fileno(stdin) has a value
of 9.</div>
<div><br>
</div>
<div>Thanks for all your help,</div>
<div>Andrei</div>
<div><br>
</div>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rtems-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/mailman/listinfo/rtems-users">http://www.rtems.org/mailman/listinfo/rtems-users</a>
</pre>
</blockquote>
<br>
</body>
</html>