Subject: (sorry!) more xargs probs -- "environment is too large" -- _SC_ARG_MAX
From: [email-masked] (Robert)

25 Oct 1996 15:55:10 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
XX-from: [email-masked] (Robert)
X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95)
Original-To: [email-masked]
Original-Sender: [email-masked]

Message has been automatically signed by PGPsendmail 1.4,
available from ftp.atnf.csiro.au:pub/people/rgooch

-----BEGIN PGP SIGNED MESSAGE-----

When I try to run my newly compiled xargs prog, I get "environment is too large
for exec".  My environment is only 3K in size.  I looked at xargs.c and it's
getting the maximum number of arguments from _SC_MAX_ARGS, if defined.  As it
turns out, _SC_ARG_MAX is defined as 0 in /i386-cygwin32/include/sys/unistd.h.

xargs.c subtracts 2048 from this number and gets -2048 (I haven't stepped
through the code, this is just my reading).  Then, it subtracts the size of
the environment (3K in my case) and comes up with another negative number.
Because it's negative, xargs aborts with "environment is too large".

This logic seems too weird.  Am I mis-reading something?  Is there a way
to fix this?

Sorry if this is a FAQ, but the mailing list archive on the web site
(http://www.cygnus.com/ml/gnu-win32) is still out of date.

- -- 
Internet: [email-masked]                   In real life: Robert Brown,
URL: http://www.c2.net/~dummy                          in sunny Berkeley, CA
          >> Copulate but don't procreate. <<          waiting for The Big One
          >> Vasectomy prevents abortion. <<           (510) 464-4604

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".