Switch to POSIX dprintf/vdprintf.

Bug: 11156955
Change-Id: I734bd02db514367ab119a48304aae9767958e367
This commit is contained in:
Elliott Hughes
2014-05-22 01:24:30 -07:00
committed by Calin Juravle
parent b2b0f7e1ae
commit fcac8ff97f
6 changed files with 141 additions and 74 deletions

View File

@@ -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 @@ extern "C" intmax_t strntoimax(const char* nptr, char** endptr, int base, size_t
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