From 46ddf0e34b03f7711a9c80f7a70dc8cbf732f782 Mon Sep 17 00:00:00 2001 From: Isaac Dunham Date: Wed, 19 Nov 2014 16:38:46 -0600 Subject: probe for getspnam(), forkpty(), utmpx, replace sethostname() Android is missing all of these; we need to probe for some so we have a config symbol to depend on. sethostname() is easily replaced. We got termios.h via pty.h; now it's not included in configure-step tools, so we need termios.h to generate globals. --- lib/portability.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/portability.c') diff --git a/lib/portability.c b/lib/portability.c index d901a4b6..29608bc1 100644 --- a/lib/portability.c +++ b/lib/portability.c @@ -5,6 +5,9 @@ */ #include "toys.h" +#if defined(__ANDROID__) +#include +#endif #if defined(__APPLE__) || defined(__ANDROID__) ssize_t getdelim(char **linep, size_t *np, int delim, FILE *stream) @@ -61,6 +64,13 @@ ssize_t getline(char **linep, size_t *np, FILE *stream) } #endif +#if defined(__ANDROID__) +int sethostname(const char *name, size_t len) +{ + return syscall(__NR_sethostname, name, len); +} +#endif + #if defined(__APPLE__) extern char **environ; -- cgit v1.2.3