LibC: Implement __fpending

Some gnu programs want this and I don't want to make FILE non-opaque
This commit is contained in:
2026-07-07 15:23:31 +03:00
parent 89fa957297
commit 304f94f3b1
2 changed files with 7 additions and 0 deletions

View File

@@ -127,6 +127,7 @@ int vsnprintf(char* __restrict s, size_t n, const char* __restrict format, va_l
int vsprintf(char* __restrict s, const char* __restrict format, va_list ap);
int vsscanf(const char* __restrict s, const char* __restrict format, va_list arg);
size_t __fpending(FILE* stream);
void __fseterr(FILE* stream);
__END_DECLS

View File

@@ -134,6 +134,12 @@ void clearerr(FILE* file)
file->error = false;
}
size_t __fpending(FILE* file)
{
ScopeLock _(file);
return file->buffer_rd_size ? 0 : file->buffer_idx;
}
void __fseterr(FILE* file)
{
ScopeLock _(file);