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.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/portability.h') diff --git a/lib/portability.h b/lib/portability.h index b7a7c794..5383efaa 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -180,10 +180,25 @@ ssize_t getline(char **lineptr, size_t *n, FILE *stream); #endif // Linux headers not listed by POSIX or LSB -#include #include #include +// Android is missing some headers and functions +#if defined(__ANDROID__) +int sethostname(const char *name, size_t len); +#endif +// "generated/config.h" is included first +#if defined(CFG_TOYBOX_SHADOW) && CFG_TOYBOX_SHADOW +#include +#endif +#if defined(CFG_TOYBOX_UTMPX) && CFG_TOYBOX_UTMPX +#include +#endif +#if defined(CFG_TOYBOX_PTY) && CFG_TOYBOX_PTY +#include +#endif + + // Some systems don't define O_NOFOLLOW, and it varies by architecture, so... #include #ifndef O_NOFOLLOW -- cgit v1.2.3