[GRASS5] Re: [winGRASS] ARG_MAX and parser.c

Eric G. Miller egm2 at jps.net
Wed Aug 8 22:48:44 EDT 2001


On Wed, Aug 08, 2001 at 05:27:02PM +0200, Markus Neteler wrote:
> Hi all,
> 
> may someone clarify below?
> 
> On Tue, Aug 07, 2001 at 04:07:06AM -0600, John Huddleston wrote:
> > Wingrass,
> > 
> > I see that someone checked in src/libes/gis/parser.c with ARG_MAX
> > It used to be 1024 in size.  The Posix size is 4096.   Normally this is
> > in the limits.h file.   Maybe we can put something in out gis.h header.
> > The char *G_recreate_command (void) function uses it lines 1365
> > and 1369.
> > 
> > #ifndef ARG_MAX
> > #define ARG_MAX 4096
> > #endif
> > 
> > Is that too large a size?
> > 
> > John Huddleston 

Hmm.  I seem to recall using ARG_MAX a while back to overcome the bug
where G_recreate_command() used a static buffer that might be too small.
However, ARG_MAX can be really huge, so it was later switched to
dynamic realloc's of 1024 until the command is "recreated".

I just did a CVS update of what I understand is the active GRASS 5.0 tree[*],
and there is no ARG_MAX at all in parser.c.  So, what gives?

*
	$ cat CVS/Tag
	Treleasebranch_11_april_2001_5_0_0

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list