libc: Add stubs for fflush() and ungetc()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-06-19 10:48:02 +02:00
parent 6bfc7483bc
commit f22689fcf5
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 14 additions and 0 deletions

View File

@ -101,6 +101,9 @@ extern "C"
/* Read a character from standard input. */
int getchar(void);
/* Push a character back to stream so that it can be read again. */
int ungetc(int c, FILE* stream);
/* Read a line from stream. */
char* fgets(char* buf, size_t size, FILE* stream);

View File

@ -46,6 +46,12 @@ static int fdopen_check_compatible_mode(int fd, int new_flags)
extern "C"
{
int fflush(FILE*)
{
// FIXME: Files are not buffered right now.
return 0;
}
FILE* fopen(const char* path, const char* mode)
{
int flags;
@ -479,4 +485,9 @@ extern "C"
if (!f) close(fd);
return f;
}
int ungetc(int, FILE*)
{
fail("FIXME: ungetc: not implemented");
}
}