aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Whitlock <busybox@mattwhitlock.name>2015-04-25 21:32:48 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-04-25 21:32:48 +0200
commitcee59053dcf47b4a3ab87f7654c1ed20620def16 (patch)
treed14818d1f81743b8849f84aa8c2fc4f01fa13e20 /include
parentde5edadee2dca2896492f97ab3a56e389305e74d (diff)
downloadbusybox-cee59053dcf47b4a3ab87f7654c1ed20620def16.tar.gz
Bionic lacks ttyname_r; provide a workaround
Signed-off-by: Matt Whitlock <busybox@mattwhitlock.name> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/platform.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h
index df9594507..d5ab7bc29 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -368,6 +368,7 @@ typedef unsigned smalluint;
#define HAVE_DPRINTF 1
#define HAVE_MEMRCHR 1
#define HAVE_MKDTEMP 1
+#define HAVE_TTYNAME_R 1
#define HAVE_PTSNAME_R 1
#define HAVE_SETBIT 1
#define HAVE_SIGHANDLER_T 1
@@ -480,6 +481,7 @@ typedef unsigned smalluint;
#if defined(ANDROID) || defined(__ANDROID__)
# undef HAVE_DPRINTF
+# undef HAVE_TTYNAME_R
# undef HAVE_GETLINE
# undef HAVE_STPCPY
# undef HAVE_STRCHRNUL
@@ -505,6 +507,11 @@ extern void *memrchr(const void *s, int c, size_t n) FAST_FUNC;
extern char *mkdtemp(char *template) FAST_FUNC;
#endif
+#ifndef HAVE_TTYNAME_R
+#define ttyname_r bb_ttyname_r
+extern int ttyname_r(int fd, char *buf, size_t buflen);
+#endif
+
#ifndef HAVE_SETBIT
# define setbit(a, b) ((a)[(b) >> 3] |= 1 << ((b) & 7))
# define clrbit(a, b) ((a)[(b) >> 3] &= ~(1 << ((b) & 7)))