mirror of
https://github.com/fluencelabs/musl
synced 2025-06-24 04:01:56 +00:00
implement the nonstandard GNU function fpurge
this is a really ugly and backwards function, but its presence will prevent lots of broken gnulib software from trying to define its own version of fpurge and thereby failing to build or worse.
This commit is contained in:
@ -158,6 +158,7 @@ int asprintf(char **, const char *, ...);
|
|||||||
int vasprintf(char **, const char *, va_list);
|
int vasprintf(char **, const char *, va_list);
|
||||||
void setlinebuf(FILE *);
|
void setlinebuf(FILE *);
|
||||||
void setbuffer(FILE *, char *, size_t);
|
void setbuffer(FILE *, char *, size_t);
|
||||||
|
int fpurge(FILE *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
11
src/stdio/fpurge.c
Normal file
11
src/stdio/fpurge.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#define _GNU_SOURCE
|
||||||
|
#include "stdio_impl.h"
|
||||||
|
|
||||||
|
int __fpurge(FILE *f)
|
||||||
|
{
|
||||||
|
f->wpos = f->wbase = f->wend = 0;
|
||||||
|
f->rpos = f->rend = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
weak_alias(__fpurge, fpurge);
|
Reference in New Issue
Block a user