Skip to content

Commit

Permalink
Add stub fflush().
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Nov 5, 2018
1 parent 8039a20 commit 60a8144
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions LibC/stdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ int feof(FILE* stream)
return stream->eof;
}

int fflush(FILE* stream)
{
// FIXME: Implement buffered streams, duh.
if (!stream)
return -EBADF;
return 0;
}

char* fgets(char* buffer, int size, FILE* stream)
{
assert(stream);
Expand Down
1 change: 1 addition & 0 deletions LibC/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ int fclose(FILE*);
void rewind(FILE*);
void clearerr(FILE*);
int feof(FILE*);
int fflush(FILE*);
size_t fread(void* ptr, size_t size, size_t nmemb, FILE*);
size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE*);
int fprintf(FILE*, const char* fmt, ...);
Expand Down

0 comments on commit 60a8144

Please sign in to comment.