summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/sysconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/sysconf.c')
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index ab9cddc306..f4e36e0c6f 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -27,6 +27,11 @@
#include <not-cancel.h>
#include <ldsodefs.h>
+/* Legacy value of ARG_MAX. The macro is now not defined since the
+ actual value varies based on the stack size. */
+#define legacy_ARG_MAX 131072
+
+
static long int posix_sysconf (int name);
@@ -83,10 +88,10 @@ __sysconf (int name)
/* Use getrlimit to get the stack limit. */
struct rlimit rlimit;
if (__getrlimit (RLIMIT_STACK, &rlimit) == 0)
- return MAX (ARG_MAX, rlimit.rlim_cur / 4);
+ return MAX (legacy_ARG_MAX, rlimit.rlim_cur / 4);
}
- return ARG_MAX;
+ return legacy_ARG_MAX;
case _SC_NGROUPS_MAX:
/* Try to read the information from the /proc/sys/kernel/ngroups_max