From b795c45fff193a60919ef952aef1dd4b74d13098 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 7 Dec 2018 18:13:42 -0800 Subject: macOS: fix getconf(1) build. Several parameters common on Linux are missing on macOS. --- toys/posix/getconf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'toys/posix') diff --git a/toys/posix/getconf.c b/toys/posix/getconf.c index 6e230efb..57c171dd 100644 --- a/toys/posix/getconf.c +++ b/toys/posix/getconf.c @@ -37,6 +37,20 @@ config GETCONF #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 +// for portability if we act like we understood but say "undefined"? +#define _SC_AVPHYS_PAGES -1 +#define _SC_THREAD_ROBUST_PRIO_INHERIT -1 +#define _SC_THREAD_ROBUST_PRIO_PROTECT -1 +#define _SC_V7_ILP32_OFF32 -1 +#define _SC_V7_ILP32_OFFBIG -1 +#define _SC_V7_LP64_OFF64 -1 +#define _SC_V7_LPBIG_OFFBIG -1 +#define _CS_V7_ENV -1 +#endif + struct config { char *name; long long value; -- cgit v1.2.3