about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--include/stdio.h1
-rw-r--r--src/stdio/fpurge.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 69178cc8..b54fe195 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -158,6 +158,7 @@ int asprintf(char **, const char *, ...);
 int vasprintf(char **, const char *, va_list);
 void setlinebuf(FILE *);
 void setbuffer(FILE *, char *, size_t);
+int fpurge(FILE *);
 #endif
 
 #ifdef __cplusplus
diff --git a/src/stdio/fpurge.c b/src/stdio/fpurge.c
new file mode 100644
index 00000000..a9e98e7b
--- /dev/null
+++ b/src/stdio/fpurge.c
@@ -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);