mescc: Tinycc support: fgetc.
* mlibc/libc-mes.c (fgetc): Implement.
This commit is contained in:
parent
0957094280
commit
7c233246d6
|
@ -216,6 +216,14 @@ getchar ()
|
||||||
return i;
|
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))
|
//#define assert(x) ((x) ? (void)0 : assert_fail (#x))
|
||||||
int
|
int
|
||||||
ungetc (int c, int fd)
|
ungetc (int c, int fd)
|
||||||
|
|
Loading…
Reference in a new issue