[ECOS] file handle problem on synthetic target
Andrew Lunn
andrew@lunn.ch
Fri Jul 2 06:58:00 GMT 2004
On Fri, Jul 02, 2004 at 09:32:14AM +1000, Helen Snitkovsky wrote:
> Hello gurus,
> I am trying to run a simple program that opens a file, print
> "Successful" if it was open, and close a file afterwards. However, file
> opening is failed when the application was compiled with the synthetic
> target. I really appreciate your help with that issue.
>
> The code is:
> #include <stdio.h>
> #include <cyg/libc/stdio/stdiofiles.hxx> // C library files
> #include <cyg/libc/stdio/stream.hxx> // C library streams
> #include <cyg/libc/stdio/io.inl> // I/O system inlines
>
> int main()
> {
>
> FILE *fp = fopen("/home/ecos/fo/mytmp", "r");
>
> if (fp == NULL)
> printf("open failed\n");
> else
> printf("open sucessful\n");
>
> fclose(fp);
>
> return 0;
> }
Does this file exist in one of the eCos file systems? You don't appear
to be mounting any file system!
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list