Fix sysconf(_SC_ARG_MAX).
ARG_MAX hasn't been a constant since Linux 2.6.23.
Bug: http://lists.landley.net/pipermail/toybox-landley.net/2016-August/008592.html
Change-Id: I1eddb562751604c75b89fa610d79be0655c53693
Test: ran the bionic tests on device and against glibc
diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py
index 773d22f..340af13 100644
--- a/libc/kernel/tools/defaults.py
+++ b/libc/kernel/tools/defaults.py
@@ -53,9 +53,10 @@
"x86": {},
}
-# Replace tokens in the output according to this mapping
+# Replace tokens in the output according to this mapping.
kernel_token_replacements = {
- "asm": "__asm__",
+ # The kernel's ARG_MAX is actually the "minimum" maximum (see fs/exec.c).
+ "ARG_MAX": "_KERNEL_ARG_MAX",
# The kernel usage of __unused for unused struct fields conflicts with the macro defined in <sys/cdefs.h>.
"__unused": "__linux_unused",
# The kernel's _NSIG/NSIG are one less than the userspace value, so we need to move them aside.