Mail Archives: djgpp-workers/1997/09/15/08:03:29
On Mon, 15 Sep 1997, Robert Hoehne wrote:
> 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
Correct.
> > 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?)
You have overlooked that ARG_MAX is a macro that calls `sysconf'.  Look 
at the beginning of xargs.c
> > 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.
Right, that's why I have left it as it is, even though 4K is a left-over 
from v1.x.
I think patching `sysconf' is the way to go.
- Raw text -