This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fgets problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]