delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/10/25/15:55:10

From: dummy AT c2 DOT net (Robert)
Subject: (sorry!) more xargs probs -- "environment is too large" -- _SC_ARG_MAX
25 Oct 1996 15:55:10 -0700 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199610252053.NAA20223.cygnus.gnu-win32@blacklodge.c2.net>
XX-from: robert_brown AT acm DOT org (Robert)
X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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: dummy AT c2 DOT net                   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


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQB1AwUBMnEoHTZMMbnCKCB9AQFpFQL/XM2ou9zk44GNYDRcu2BSY76uTxPPyc9N
hWyYeH+fYjkDfAagnAeESMJEGK6pTg9oeAzHxV2AvTNAnECTOmZn3oZUos5JP0M4
0VS3ddFdmuJxpeLU+xQlaerrw93PKLqq
=qjRq
-----END PGP SIGNATURE-----

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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