Problems with System V Release 2.1 on 68010

BALDWIN mike at whuxl.UUCP
Sat Apr 19 08:43:35 AEST 1986


> In article <412 at hropus.UUCP> ka at hropus.UUCP (Kenneth Almquist) writes:
> >[`#! /bin/sh' is] a Berkeley feature.  One weakness is that if
> >you are running /bin/sh and invoke a shell procedure which begins
> >with "#!/bin/sh", the kernel will exec /bin/sh even though /bin/sh
> >is already running, so there is a cost to this approach.
> 
> The /bin/sh that is already running would have to fork to run
> the script anyway, so this `cost' really amounts to the extra
> code in the kernel required to perform this indirection.
> 
> In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415)

There is a real extra cost, the exec of /bin/sh.  Of course you always
have to fork, but you don't have to exec.  True, the text space is
shared and the data space may not be too big, but the kernel has to
clean up mem mgmt and then redo it, plus copying the environment.
-- 
						Michael Baldwin
			(not the opinions of)	AT&T Bell Laboratories
						{at&t}!whuxl!mike



More information about the Comp.unix.wizards mailing list