summaryrefslogtreecommitdiff
path: root/src/libc-stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libc-stdio.c')
-rw-r--r--src/libc-stdio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libc-stdio.c b/src/libc-stdio.c
index 34fe40d..0d19f20 100644
--- a/src/libc-stdio.c
+++ b/src/libc-stdio.c
@@ -28,12 +28,27 @@ bionic_file_to_glibc_file(FILE *f)
return f;
}
+// libstdc++ uses these directly for standard streams, thus we need to wrap em
+// and IO_file wraps aren't enough.
+
int
bionic_fflush(FILE *f)
{
return fflush(bionic_file_to_glibc_file(f));
}
+size_t
+bionic_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
+{
+ return fwrite(ptr, size, nmemb, bionic_file_to_glibc_file(stream));
+}
+
+int
+bionic_putc(int ch, FILE *f)
+{
+ return putc(ch, bionic_file_to_glibc_file(f));
+}
+
// Wrapping internal glibc VTABLE functions to handle bionic's pre-M crap
// We define __real_IO_file_xsputn in libc.c so linker will link our library,
// it's not used however for anything.