LibC: Implement __fpending
Some gnu programs want this and I don't want to make FILE non-opaque
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user