Arg list too big

Hibbard T. Smith JR smitty at essnj1.ESSNJAY.COM
Wed Mar 13 22:54:16 AEST 1991


I've been trying to get the gnu project's Make (3.58) running on an Interactive
2.2 system.  It runs fine and offers many nice features.  Here comes the 
problem:

When trying to use it to control the build of the X11r4 distribution, I get an
error when do make depend in lib/X.  The command make builds looks like:

  ../.././util/makedepend/makedepend -s "# DO NOT DELETE #" -I../../. -I. -- *.c

This elicits an error message that looks like:

	sh: ../.././util/makedepend/makedepend: arg list too long

This same script and makefile work fine with regular ATT make.  There are
252 c files in the directory, and the makefile has done a cd into it, so the
file names are short and sweet.  No paths attached to each one.

This is being done with an execve call to exec the shell, and the envp points
to a fairly large environment.  The arguments are being passed with the "-c"
option to the shell.  The error appears to be coming from the shell, and 
happens with /bin/sh or bash.

I know that the exec system calls can only pass 5120 (10240) bytes.  This 
argument is only *.c when passed by the exec.  

Does the shell impose a limit on what can be passed by the"-c" option?

When is the *.c expanded?  Before or after it gets to the shell?  I thought
the shell did the expansion, in which case the argument list to the shell
is only *.c.

Does the original sh expand the argument and then pass the expande list to
a second shell because of the "-c" argument?

This has me very confused, and I'd appreciate any help I can get.

Reply by mail, or if there's enough interest, post to comp.unix.internals.

-- 
		Smitty
-------------------------------------------
Hibbard T. Smith JR                 smitty at essnj1.ESSNJAY.COM	
ESSNJAY Systems Inc.                uunet!hsi!essnj1!smitty



More information about the Comp.unix.sysv386 mailing list