Subject: Re: Shell avoidance in make-3.79.1-3
From: Earl Chew <[email-masked]>
To: Randall R Schulz <[email-masked]>
Cc: [email-masked]
Date: Mon, 25 Jun 2001 16:59:36 -0700

Randall R Schulz wrote:
> What are you trying to do? What do you mean by "/bin/sh avoidance?"
> 
> Make has no ability to interpret commands, and relies on a shell to do 
> that for each command it decides to invoke.

I you look at the source code (construct_command_argv in in job.c)
you'll find some code that looks carefully at the command line.

If the command line is sufficiently simply (eg sleep 15), make
will perform an optimization whereby it starts the command
directly. That is, instead of:

	sh -c 'sleep 15'

make will invoke the following directly:

	sleep 15

thus avoiding the overhead of a fork/exec of /bin/sh.

Earl
-- 
> ---------------------------------------------------------------------+
> Earl Chew                              http://www.agilent.com        |
> Agilent Technologies                   mailto:[email-masked]  |
> Advanced Networks Division             Tel:   +1 604 454 3411        |
> 2500-4710 Kingsway                     Fax:   +1 604 454 3401        |
> Burnaby BC V5H 4M2 Canada                                            |
> ---------------------------------------------------------------------+

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple