Add back TERMUX_PREFIX in patch
[termux-packages] / ndk_patches / stdio.h.patch
CommitLineData
59f0d218
FF
1diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/stdio.h ./usr/include/stdio.h
2--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm/usr/include/stdio.h 2014-10-14 22:53:49.000000000 -0400
9867ff1a
FF
3+++ ./usr/include/stdio.h 2015-12-24 03:07:45.028840214 -0500
4@@ -52,6 +52,8 @@
5 #include <stdarg.h>
6 #include <stddef.h>
7
8+#include <string.h> /* For strcpy(3) used by ctermid() */
9+
10 #define __need_NULL
11 #include <stddef.h>
12
13@@ -193,7 +195,7 @@
14
59f0d218
FF
15 /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
16 #if __BSD_VISIBLE || __XPG_VISIBLE
17-#define P_tmpdir "/tmp/"
c501b827 18+#define P_tmpdir "@TERMUX_PREFIX@/tmp/"
59f0d218
FF
19 #endif
20 #define L_tmpnam 1024 /* XXX must be == PATH_MAX */
21 #define TMP_MAX 308915776
9867ff1a 22@@ -371,6 +373,16 @@
59f0d218
FF
23 #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
24 #endif /* __BSD_VISIBLE */
9867ff1a 25
59f0d218
FF
26+/* Needed by gnulibs freading() */
27+#define __sferror(p) (((p)->_flags & __SERR) != 0)
28+
93b884f1
FD
29+/* Used by perl, fish, and others */
30+static char* ctermid(char* s) {
31+ if (s == 0) return "/dev/tty";
32+ strcpy(s, "/dev/tty");
33+ return s;
34+}
35+
59f0d218 36 #if defined(__BIONIC_FORTIFY)
9867ff1a 37
59f0d218 38 __BEGIN_DECLS