feat(userspace/libc): implement feof() and ferror() functions

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
EnderIce2 2025-02-21 02:43:00 +02:00
parent 77136acccd
commit db5a42289a
No known key found for this signature in database
GPG Key ID: 2EE20AF089811A5A
2 changed files with 16 additions and 4 deletions

View File

@ -91,8 +91,8 @@ extern "C"
int dprintf(int, const char *restrict, ...);
int fclose(FILE *stream);
FILE *fdopen(int, const char *);
int feof(FILE *);
int ferror(FILE *);
int feof(FILE *stream);
int ferror(FILE *stream);
int fflush(FILE *stream);
int fgetc(FILE *stream);
int fgetpos(FILE *restrict, fpos_t *restrict);

View File

@ -81,8 +81,20 @@ export int fclose(FILE *stream)
}
export FILE *fdopen(int, const char *);
export int feof(FILE *);
export int ferror(FILE *);
export int feof(FILE *stream)
{
if (!stream)
return 0;
return stream->eof;
}
export int ferror(FILE *stream)
{
if (!stream)
return 0;
return stream->error;
}
export int fflush(FILE *stream)
{