Console question

Thomas Rauscher trauscher at loytec.com
Thu Nov 4 07:13:48 UTC 2004



  

> -----Original Message-----
> From: Etienne Fortin [mailto:etienne.fortin at sensio.tv] 
> Sent: Wednesday, November 03, 2004 8:14 PM
> To: rtems-users at rtems.com
> Subject: Console question
> 
> Hi everyone,
> Question: What can cause the fact that characters pushed into the
> console by rtems_termios_enqueue_raw_characters() are not "seen" by
> fgetc(stdin)? 
> 
> Situation: I can get some characters from stdin by using both fgetc()
> fread(). After some characters are received (about 1k), the received
> characters are pushed into the console (I single stepped the interrupt
> handler and rtems_termios_enqueue_raw_characters() is called), fgetc()
> repeatedly returns EOF. 
> 
> Anyone with experience with a similar problem? Can it has to 
> do with the
> fact that stdin is line buffered?
> 
> Thanks,
> 
> Etienne Fortin
> Sensio
> 
> 

I think, this is because the error indicator for the stdin
stream is set in the FILE structure, once a EOF has been read.

You should call clearerr(stdin) to reset the error indicator after
a timeout. 

Regards,
Thomas Rauscher

--
Thomas Rauscher
LOYTEC electronics GmbH




More information about the users mailing list