[ECOS] fgets problem
Andrew Lunn
andrew.lunn@ascom.ch
Fri Jun 27 07:26:00 GMT 2003
On Thu, Jun 26, 2003 at 03:58:49PM -0500, Aaron Richardson wrote:
> I have problems with fgets. Here is a simple program that I am using that
> reproduces my problem:
>
> #include <stdio.h>
> int main(void)
> {
> char s[255];
>
> printf("Hello, eCos world!\n>");
>
> while(1) {
> fgets(s, 255, stdin);
> printf("You typed: %s\n>", s);
> }
>
> return 0;
> }
>
> The code seems to lockup in the fgets. Any ideas on where to begin fixing
> this?
Its probably not broken. Im guessing you are trying to do a read on
the diagnostic serial interface, ie the one gdb is attached to. This
is deliberately not supported. Search the archives, this has been
discussed quite a few times.
To do input you need to use a proper serial driver and not the
diagnostic driver. Add the appropriate serial driver to your
configuration and it should work.
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list