Mailinglist Archive: opensuse (2459 mails)

< Previous Next >
Re: [opensuse] /bin/rm: Argument list too long
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Fri, 28 Mar 2008 11:14:54 -0700
  • Message-id: <200803281114.55029.rschulz@xxxxxxxxx>
On Friday 28 March 2008 11:05, Sam Clemens wrote:
Randall R Schulz wrote:
On Friday 28 March 2008 01:23, Wolfgang Woehl wrote:
Randall R Schulz:
There's no way for xargs to know about anything other
than the kernel-imposed argument list size limit.

Where can I read the argument list size limit? I fail to see
anything relevant with ulimit -a or in proc or in pam's

% egrep ARG_MAX /usr/include/linux/limits.h
#define ARG_MAX 131072    /* # bytes of args + environ for exec() */

And I believe there's also a maximum size to the number of
pointers in the array char *argv[].

I only know how it was implemented in the old (very old) days, but the
representation of the arguments + environment was simply as a blob of
bytes with NUL bytes deliminting individual arguments and a pointer
marking the end of the arguments and the beginning of the environment.
The vectors of argument and environment value pointers was reconstituted
in the user mode code on the "other side" of the exec call.

If that's still the scheme being used, then it doesn't matter how many
individual arguments and environment variables there are, just the
number of bytes it takes to hold them all (including the delimiting /
separating NULs).

Randall Schulz
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >