musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/ext2.c
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 /src/stdio/ext2.c
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...
Diffstat (limited to 'src/stdio/ext2.c')
-rw-r--r--src/stdio/ext2.c 24
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;
+}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月06日 16:00:56 +0000

AltStyle によって変換されたページ (->オリジナル) /