This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: fgets problem
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Aaron Richardson <aarichar at cisco dot com>
- Cc: Ecos-Discuss <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 27 Jun 2003 09:26:44 +0200
- Subject: Re: [ECOS] fgets problem
- References: <200306261558.49320.aarichar@cisco.com>
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