mlibc: GNU Gcc support: ferror.

* lib/libc-mes+tcc.c (ferror): New function.
* include/stdio.h (ferror): Declare it.
This commit is contained in:
Jan Nieuwenhuizen 2017-11-25 22:57:18 +01:00
parent 7ab279bf7b
commit 83f2a55c2c
2 changed files with 10 additions and 1 deletions

View file

@ -100,7 +100,8 @@ int eputs (char const* s);
int fclose (FILE *stream);
FILE *fdopen (int fd, char const *mode);
int fflush (FILE *stream);
FILE *fopen (char const *pathname, char const *mode);
FILE *fopen (char const *pathname, char const *mode);
int ferror (FILE *stream);
int fprintf (FILE *stream, char const *format, ...);
int fdputc (int c, int fd);
int fputc (int c, int fd);

View file

@ -108,6 +108,14 @@ fdopen (int fd, char const *mode)
return (FILE*)fd;
}
int
ferror (FILE *stream)
{
int fd = (int)stream;
if (fd == -1) return -1;
return 0;
}
int
fflush (FILE *stream)
{