lkml.org 
[lkml]   [2000]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Argument list too long: out of environment space
Stuart Inglis wrote:
> /*
> * MAX_ARG_PAGES defines the number of pages allocated for arguments
> * and envelope for the new program. 32 should suffice, this gives
> * a maximum env+arg of 128kB w/4KB pages!
> */
> #define MAX_ARG_PAGES 32
>
> This seems to be the cause of our problem. When the total size of the
> command line is over 128kB we start encountering this problem.
>
> Can this value be safely increased? Does it need to be constant at all?

Yes it can be increased. I had a project with 1MB command lines, so we
increased MAX_ARG_PAGES and everything was fine. Until our command
lines grew too long again... :-)

We looked for a way to use smaller command lines. Not xargs -- that
didn't do the right thing. We could change our commands to read the
list of files, but we didn't find a way to convince Make to write the
**ing list of files to a file. "echo $(FILES) > listfile" doesn't work
for the obvious reason.
I was really tempted to add a $(echo $(FILES)) function to GNU Make to
get around this.

But the quicker solution at the time was to increase MAX_ARG_PAGES and
it was fine.

Feel free to remove the limit altogether and make it dynamic. Something
involving an extra struct mm which you are filling up ptrace-style might
be appropriate. It must be pageable if it can be arbitrarily large.

have a nice day,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [from the cache]
©2003-2011 Jasper Spaans