summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-06-19 01:35:23 -0400
committerRich Felker <dalias@aerifal.cx>2012-06-19 01:35:23 -0400
commite15171b8d8e80e8b5bcf4e95b1709697858f545a (patch)
tree36063ba211b93e894fb891db9e04599b70e86f6e
parenta71e0af25544fd2486e57ea51c6d05abdbf44c3e (diff)
downloadmusl-e15171b8d8e80e8b5bcf4e95b1709697858f545a.tar.gz
add new stdio extension functions to make gnulib happy
this is mildly ugly, but less ugly than gnulib trying to poke at the definition of the FILE structure...
-rw-r--r--src/stdio/ext2.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stdio/ext2.c b/src/stdio/ext2.c
new file mode 100644
index 00000000..e587d64b
--- /dev/null
+++ b/src/stdio/ext2.c
@@ -0,0 +1,24 @@
+#include "stdio_impl.h"
+
+size_t __freadahead(FILE *f)
+{
+ return f->rend - f->rpos;
+}
+
+const char *__freadptr(FILE *f, size_t *sizep)
+{
+ size_t size = f->rend - f->rpos;
+ if (!size) return 0;
+ *sizep = size;
+ return f->rpos;
+}
+
+void __freadptrinc(FILE *f, size_t inc)
+{
+ f->rpos += inc;
+}
+
+void __fseterr(FILE *f)
+{
+ f->flags |= F_ERR;
+}