]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r230998,r233792: sh: Use vfork in a few common cases.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 7 Apr 2013 21:25:14 +0000 (21:25 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 7 Apr 2013 21:25:14 +0000 (21:25 +0000)
commit078e395216bcf1200dde054867c7f370c2c56a76
treeedca74cabccec7e461b7422b47208e5bf5b95c26
parent4b0dc9ead9374d2af31afe6070714387d3538375
MFC r230998,r233792: sh: Use vfork in a few common cases.

This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked
child.

Various incarnations of this patch have been shown to bring performance
improvements:
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html

The use of vfork() can be disabled by setting a variable named
SH_DISABLE_VFORK.

git-svn-id: svn://svn.freebsd.org/base/stable/9@249242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/eval.c
bin/sh/jobs.c
bin/sh/jobs.h
bin/sh/var.c
bin/sh/var.h