delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/15/06:01:45

Date: Mon, 15 Sep 1997 11:59:51 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: Oberhumer Markus <k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at>,
DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: c1args.c patches
In-Reply-To: <Pine.SUN.3.91.970911165510.13452C-100000@is>
Message-Id: <Pine.HPP.3.95q.970915113143.10570D-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019