Mail Archives: djgpp-workers/1997/09/15/06:01:45
On Thu, 11 Sep 1997, Eli Zaretskii wrote:
> > maximal argument lenght. And this is for DJGPP 4096!!
>
> And what's wrong with this? I have dwelled on this issue for quite a
> while when I ported `xargs', but finally decided to leave it alone. The
> code in `xargs' uses up to 2KB (4096 - 2048) of arguments before it
> decides that the command line is too long and should be divided into few
> chunks.
>
> This is consistent with the DJGPP's minimum transfer buffer size of 2KB.
>
> `xargs' also has a switch to make the limit other than the default, so if
> you need it, you can use it.
Yes of course you can use this switch, but that's an other topic.
Maybe I described the problem not correct. xargs does the check
for the limitet ARG_MAX _before_ examining the commandline. That
means, if the environment size is larger than 2048 bytes xargs
will exit with the "environment is too large for exec" message
(when using make, the possibility that the environment is
larger than 2048 is very high)
> A better way would be to change `sysconf' so that it returns the actual
> size of the transfer buffer. It's a trivial change, so now seems like a
This might be good but not helpfull for xargs, since it doesn't use
it (or have I overlooked something?)
> I think this is wrong, because the transfer buffer may be stubedited to
> make it less than that. If anything, you should make the limit
> *smaller* (2K), not larger. Enlarging it is unsafe.
But remember. If you set ARG_MAX to 2048 xargs will never work,
since it substracts from ARG_MAX 2048 and if the resulting value
<= 0 it aborts.
Robert
- Raw text -