delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/15/08:03:29

Date: Mon, 15 Sep 1997 15:02:31 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
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.HPP.3.95q.970915113143.10570D-100000@newton.mathematik.tu-chemnitz.de>
Message-ID: <Pine.SUN.3.91.970915145902.22620N-100000@is>
MIME-Version: 1.0

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 -


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