diff options
author | Elliott Hughes <enh@google.com> | 2019-08-22 12:12:37 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-08-23 10:57:14 -0500 |
commit | d6bb677517c5bd06983c3163e680b1f77717af2c (patch) | |
tree | 7c6bfef8dcddf0aca5d9e5c130a37e642953dd6d /toys/posix | |
parent | ee8eca90ec9cfd589b8bf03517a62b6c7a664bf1 (diff) | |
download | toybox-d6bb677517c5bd06983c3163e680b1f77717af2c.tar.gz |
getconf: remove workaround for old NDKs.
macOS remains awkward, though, but this retains our Android/Linux
behavior and is closer to the platform's getconf(1) for macOS.
Strictly macOS denies all knowledge of UIO_MAXIOV, but the "undefined"
you'll get from this patch seems closer than the "1024" we used to
give.
Diffstat (limited to 'toys/posix')
-rw-r--r-- | toys/posix/getconf.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/toys/posix/getconf.c b/toys/posix/getconf.c index 57c171dd..c5e05489 100644 --- a/toys/posix/getconf.c +++ b/toys/posix/getconf.c @@ -31,12 +31,6 @@ config GETCONF #define _SC_XOPEN_UUCP -1 #endif -// When NDK r19 ships in 2018Q4, switch to _SC_UIO_MAXIOV. -// (Until then use this workaround for musl.) -#ifndef UIO_MAXIOV -#define UIO_MAXIOV 1024 -#endif - #ifdef __APPLE__ // macOS doesn't have a bunch of stuff. The actual macOS getconf says // "no such parameter", but -- unless proven otherwise -- it seems more useful @@ -44,6 +38,7 @@ config GETCONF #define _SC_AVPHYS_PAGES -1 #define _SC_THREAD_ROBUST_PRIO_INHERIT -1 #define _SC_THREAD_ROBUST_PRIO_PROTECT -1 +#define _SC_UIO_MAXIOV -1 #define _SC_V7_ILP32_OFF32 -1 #define _SC_V7_ILP32_OFFBIG -1 #define _SC_V7_LP64_OFF64 -1 @@ -108,7 +103,7 @@ struct config sysconfs[] = { CONF(PAGESIZE), CONF(RAW_SOCKETS), CONF(RE_DUP_MAX), CONF(RTSIG_MAX), CONF(SEM_NSEMS_MAX), CONF(SEM_VALUE_MAX), CONF(SIGQUEUE_MAX), CONF(STREAM_MAX), CONF(SYMLOOP_MAX), CONF(TIMER_MAX), CONF(TTY_NAME_MAX), - CONF(TZNAME_MAX), + CONF(TZNAME_MAX), CONF(UIO_MAXIOV), /* Names that just don't match the symbol, do it by hand */ {"_AVPHYS_PAGES", _SC_AVPHYS_PAGES}, {"_PHYS_PAGES", _SC_PHYS_PAGES}, @@ -159,7 +154,7 @@ struct config limits[] = { CONF(CHAR_MAX), CONF(CHAR_MIN), CONF(INT_MAX), CONF(INT_MIN), CONF(SCHAR_MAX), CONF(SCHAR_MIN), CONF(SHRT_MAX), CONF(SHRT_MIN), CONF(SSIZE_MAX), CONF(UCHAR_MAX), CONF(UINT_MAX), CONF(ULONG_MAX), CONF(USHRT_MAX), - CONF(UIO_MAXIOV), CONF(CHAR_BIT), + CONF(CHAR_BIT), /* Not available in glibc without _GNU_SOURCE. */ {"LONG_BIT", 8*sizeof(long)}, {"WORD_BIT", 8*sizeof(int)}, |