3

Specifically, I would like to edit the value of the system configuration variable ARG_MAX. (It is preset on kernels before 2.6.23 and I want to increase it.)

How do I do this? Does this require editing the kernel?

This is on RHEL/CentOS.

3
  • ARG_MAX is defined by POSIX, so it should be present in much earlier versions that that. Commented Mar 27, 2013 at 16:46
  • 1
    What's the version of your kernel ? If you consider to use a lot of argument, maybe xargs is the solution ? What's your real problem ? Commented Mar 27, 2013 at 17:07
  • kernel version is 2.6.18-238.el5. The command with too many args is coming from an external program which is why I want to change the max args. Commented Mar 27, 2013 at 17:23

1 Answer 1

5

The values returned by getconf(1) aren't variables, they are mostly system values for limits some standard (mostly POSIX) defines.

Many of the minimal values defined by the relevant standard are just too small (the standards often define minimal usable values, to be able to cover even very limited environments; so as to not unduly constrain larger instalations it is allowed to have larger limits. And so you can find out what the limits are you get getconf(1)).

In Linux' case (Fedora 18 here), the value of ARG_MAX is a ridiculously large 2097152 (2MiB worth of arguments!). If you need more than that, serious rethinking is mandated. Use xargs(1) to process the argument list in batches, or process them as they are generated instead of batching them up.

2
  • actually this machine returns 131072 for ARG_MAX. You are on a kernel newer than 2.6.23 and so your ARG_MAX is equal to 1/4 of your userspace stack size. Commented Mar 27, 2013 at 20:00
  • 1
    so they can't be changed? Commented Mar 28, 2013 at 1:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.