[Toybox] [PATCH] macOS: fix getconf(1) build.

enh enh at google.com
Fri Dec 7 18:17:45 PST 2018


Several parameters common on Linux are missing on macOS.
---
 toys/posix/getconf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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;
-- 
2.19.0.605.g01d371f741-goog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-macOS-fix-getconf-1-build.patch
Type: application/octet-stream
Size: 1140 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20181207/a0c7bb2c/attachment-0002.obj>


More information about the Toybox mailing list