mescc: Tinycc support: fgetc.

* mlibc/libc-mes.c (fgetc): Implement.
This commit is contained in:
rain1 2017-07-30 08:28:19 -04:00 committed by Jan Nieuwenhuizen
parent 0957094280
commit 7c233246d6

View file

@ -216,6 +216,14 @@ getchar ()
return i;
}
int
fgetc (int fd)
{
char c;
int r = read (fd, &c, 1);
return c == 1 ? c : (-1);
}
//#define assert(x) ((x) ? (void)0 : assert_fail (#x))
int
ungetc (int c, int fd)