delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/25/20:29:28

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B37D068.1F797DA8@agilent.com>
Date: Mon, 25 Jun 2001 16:59:36 -0700
From: Earl Chew <earl_chew AT agilent DOT com>
Organization: Agilent Technologies
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Randall R Schulz <rrschulz AT cris DOT com>
Cc: cygwin AT cygwin DOT com
Subject: Re: Shell avoidance in make-3.79.1-3
References: <3B37B58B DOT F87EA366 AT agilent DOT com>
<3B37B58B DOT F87EA366 AT agilent DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20010625161345 DOT 0257c1d8 AT pop3 DOT cris DOT com>

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:earl_chew AT agilent DOT com  |
> 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

- Raw text -


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