Problems redirecting stdin/out for a task in 4.6.99.2

Till Straumann strauman at slac.stanford.edu
Fri Jan 6 00:05:19 UTC 2006


Brett Swimley wrote:
> Till -
> 
> I'm noticing something similar to this with the rtems_monitor 
> (mon-monitor.c).  I tried your change by adding
> 
> fileno(STDIN_FILENO);

This is certainly bad, bad. fileno() expects a 'FILE *' argument
but you give it what it is supposed to return (an integer file descriptor).

> 
> prior to the tcgetattr, and tcsetattr calls for STDIN_FILENO.
> I also tried fileno(stdout) as you suggested.

Please attach your code.

T.

> 
> Still no luck.
> 
> Any other thoughts or comments?
> 
> Regards,
> 
> Brett Swimley
> 
> Till Straumann wrote:
> 
>> Hmm - I do something very similar in a modified version of telnetd.c 
>> and indeed did observe
>> something similar.
>>
>>  
>>
>>> - has anybody already fixed this?
>>>   
>>
>>
>> Here's my workaround:
>>
>>    /* newlib hack/workaround. Before we change stdin/out/err we must make
>>     * sure the internal data are initialized (fileno(stdout) has this 
>> sideeffect).
>>     * This should probably be done from RTEMS' libc support layer...
>>     * (T.S., newlibc-1.13; 2005/10)
>>     */
>>
>>
>>
>>    fileno(stdout);
>>
>>
>>
>> HTH
>> -- Till
>>
>>  
>>
>>> wkr,
>>> Thomas Doerfler.
>>>
>>>   
> 
> 




More information about the users mailing list