Switch to POSIX dprintf/vdprintf.
Bug: 11156955
Change-Id: I734bd02db514367ab119a48304aae9767958e367
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index 2fed492..295418b 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -32,6 +32,7 @@
#include <ctype.h>
#include <inttypes.h>
#include <pthread.h>
+#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/time.h>
@@ -184,4 +185,18 @@
return (intmax_t) strntoumax(nptr, endptr, base, n);
}
+// POSIX calls this dprintf, but LP32 Android had fdprintf instead.
+extern "C" int fdprintf(int fd, const char* fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ int rc = vdprintf(fd, fmt, ap);
+ va_end(ap);
+ return rc;
+}
+
+// POSIX calls this vdprintf, but LP32 Android had fdprintf instead.
+extern "C" int vfdprintf(int fd, const char* fmt, va_list ap) {
+ return vdprintf(fd, fmt, ap);
+}
+
#endif