diff --git a/src/lib/libc_old/stdio/feof.c b/src/lib/libc_old/stdio/feof.c index d9d17d7..1d2518b 100644 --- a/src/lib/libc_old/stdio/feof.c +++ b/src/lib/libc_old/stdio/feof.c @@ -31,22 +31,53 @@ #include #include -int feof(FILE *fd) +typedef struct _feof { + FILE *fp; + int status; +} feof_t; + + + +int feof(FILE *fp) +{ + feof_t f; + + f = malloc(sizeof *f); + if(f == NULL) + { + printf("feof.c: out of memory"); + return -1; + } + if(fd == NULL) { return -1; } + f->fp = fp; asm volatile( "int %0\n" - : : "i" (0x80),"a" (9),"b" (fd) + : : "i" (0x80),"a" (9),"b" (f) ); - return((FILE *)fp); + + if(f->status == 0) + { + free(f); + return 0; + } + else + { + free(f); + return 1; + } } /*** $Log$ + Revision 1.1 2005/08/05 09:48:10 fsdfs + feof() syscall implemented + Revision 1.4 2004/07/28 15:05:43 reddawg Major: Pages now have strict security enforcement.