aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-12-07 18:13:42 -0800
committerRob Landley <rob@landley.net>2018-12-07 21:09:27 -0600
commitb795c45fff193a60919ef952aef1dd4b74d13098 (patch)
treefdcd126a9641e0fa0af895d54222f28cb4749312
parentfcbe8c639d60c4ed844204e7291746220de0b2ee (diff)
downloadtoybox-b795c45fff193a60919ef952aef1dd4b74d13098.tar.gz
macOS: fix getconf(1) build.
Several parameters common on Linux are missing on macOS.
-rw-r--r--toys/posix/getconf.c14
1 files changed, 14 insertions, 0 deletions
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;