diff options
author | Ron Yorston <rmy@pobox.com> | 2024-08-19 08:06:19 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-08-19 08:06:19 +0100 |
commit | 4b7b4a960bab5b3e331e130b257fe8280fd9da43 (patch) | |
tree | 78aa6a26f38c4a279ab7310992e2259be3f5ece5 /arch | |
parent | b21899038683bd646446d3db9e84f64ea669d2ed (diff) | |
download | busybox-w32-4b7b4a960bab5b3e331e130b257fe8280fd9da43.tar.gz busybox-w32-4b7b4a960bab5b3e331e130b257fe8280fd9da43.tar.bz2 busybox-w32-4b7b4a960bab5b3e331e130b257fe8280fd9da43.zip |
ash: optimise running of scripts
The BusyBox shell detects certain cases where forking a command is
unnecessary (last command in a script or subshell, for example) and
calls execve(2) instead. This doesn't help in the Windows port
because execve(2) is implemented by creating a process.
There is one case where it is possible to apply this optimisation:
if the command is a script and the script interpreter is an applet.
- Have evalcommand() pass a flag to indicate this situation to
shellexec(). Also, allocate two spare elements before the start
of the argv array.
- If the flag is TRUE shellexec() passes the shell's PATH variable
down to tryexec() so it can perform a test for applet override.
- If tryexec() finds that all the necessary conditions apply it
can run a script by directly invoking the interpreter's main().
Adds 192-224 bytes.
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions