summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/include/stdio.h12
-rw-r--r--libc/libc.arm.map4
-rw-r--r--libc/libc.map.txt4
-rw-r--r--libc/libc.mips.map4
-rw-r--r--libc/libc.x86.map4
5 files changed, 20 insertions, 8 deletions
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index ca5643744..b103990d6 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -151,8 +151,20 @@ int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict _Nonnull, __va_list) __printflike(2, 0);
int vprintf(const char * __restrict _Nonnull, __va_list) __printflike(1, 0);
+#if __ANDROID_API__ >= 21
int dprintf(int, const char* __restrict _Nonnull, ...) __printflike(2, 3) __INTRODUCED_IN(21);
int vdprintf(int, const char* __restrict _Nonnull, __va_list) __printflike(2, 0) __INTRODUCED_IN(21);
+#else
+/*
+ * Old versions of Android called these fdprintf and vfdprintf out of fears that the glibc names
+ * would collide with user debug printfs.
+ *
+ * Allow users to just use dprintf and vfdprintf on any version by renaming those calls to their
+ * legacy equivalents if needed.
+ */
+int dprintf(int, const char* __restrict _Nonnull, ...) __printflike(2, 3) __RENAME(fdprintf);
+int vdprintf(int, const char* __restrict _Nonnull, __va_list) __printflike(2, 0) __RENAME(vfdprintf);
+#endif
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 201112L) || \
(defined(__cplusplus) && __cplusplus <= 201103L)
diff --git a/libc/libc.arm.map b/libc/libc.arm.map
index a4212dda7..a22923ef2 100644
--- a/libc/libc.arm.map
+++ b/libc/libc.arm.map
@@ -343,6 +343,7 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
+ fdprintf; # arm x86 mips versioned=28
feof;
feof_unlocked; # introduced=23
ferror;
@@ -1105,6 +1106,7 @@ LIBC {
vdprintf; # introduced=21
verr;
verrx;
+ vfdprintf; # arm x86 mips versioned=28
vfork;
vfprintf;
vfscanf;
@@ -1507,7 +1509,6 @@ LIBC_PRIVATE {
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
- fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips
get_malloc_leak_info;
@@ -1529,7 +1530,6 @@ LIBC_PRIVATE {
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
- vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
diff --git a/libc/libc.map.txt b/libc/libc.map.txt
index c271a57e4..d4c36d500 100644
--- a/libc/libc.map.txt
+++ b/libc/libc.map.txt
@@ -345,6 +345,7 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
+ fdprintf; # arm x86 mips versioned=28
feof;
feof_unlocked; # introduced=23
ferror;
@@ -1130,6 +1131,7 @@ LIBC {
vdprintf; # introduced=21
verr;
verrx;
+ vfdprintf; # arm x86 mips versioned=28
vfork;
vfprintf;
vfscanf;
@@ -1533,7 +1535,6 @@ LIBC_PRIVATE {
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
- fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips
get_malloc_leak_info;
@@ -1555,7 +1556,6 @@ LIBC_PRIVATE {
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
- vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
diff --git a/libc/libc.mips.map b/libc/libc.mips.map
index 214c7f506..35a674ee1 100644
--- a/libc/libc.mips.map
+++ b/libc/libc.mips.map
@@ -341,6 +341,7 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
+ fdprintf; # arm x86 mips versioned=28
feof;
feof_unlocked; # introduced=23
ferror;
@@ -1103,6 +1104,7 @@ LIBC {
vdprintf; # introduced=21
verr;
verrx;
+ vfdprintf; # arm x86 mips versioned=28
vfork;
vfprintf;
vfscanf;
@@ -1349,7 +1351,6 @@ LIBC_PRIVATE {
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
- fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips
get_malloc_leak_info;
@@ -1370,7 +1371,6 @@ LIBC_PRIVATE {
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
- vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;
diff --git a/libc/libc.x86.map b/libc/libc.x86.map
index 145b64ebf..0e130ce39 100644
--- a/libc/libc.x86.map
+++ b/libc/libc.x86.map
@@ -339,6 +339,7 @@ LIBC {
fdatasync;
fdopen;
fdopendir;
+ fdprintf; # arm x86 mips versioned=28
feof;
feof_unlocked; # introduced=23
ferror;
@@ -1101,6 +1102,7 @@ LIBC {
vdprintf; # introduced=21
verr;
verrx;
+ vfdprintf; # arm x86 mips versioned=28
vfork;
vfprintf;
vfscanf;
@@ -1348,7 +1350,6 @@ LIBC_PRIVATE {
dlmalloc_inspect_all; # arm x86 mips
dlmalloc_trim; # arm x86 mips
dlmalloc_usable_size; # arm x86 mips
- fdprintf; # arm x86 mips
free_malloc_leak_info;
ftime; # arm x86 mips
get_malloc_leak_info;
@@ -1369,7 +1370,6 @@ LIBC_PRIVATE {
strtotimeval; # arm x86 mips
sysv_signal; # arm x86 mips
tkill; # arm x86 mips
- vfdprintf; # arm x86 mips
wait3; # arm x86 mips
wcswcs; # arm x86 mips
} LIBC_O;