diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-10 12:10:08 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-10 12:10:08 +0000 |
commit | 05743d79496cf96e9f6f645b6bbc165d51e6aa5c (patch) | |
tree | 50fb492810d898cdcafe63009bbb08a1dde039ca /shell/hush_doc.txt | |
parent | 68e8e96d7fba018b5b2354434fe0ae95fdfffc4f (diff) | |
download | busybox-w32-05743d79496cf96e9f6f645b6bbc165d51e6aa5c.tar.gz busybox-w32-05743d79496cf96e9f6f645b6bbc165d51e6aa5c.tar.bz2 busybox-w32-05743d79496cf96e9f6f645b6bbc165d51e6aa5c.zip |
hush: reinstate `cmd` handling for NOMMU (with fat big warning).
hush: fix a case where none of pipe members could be started
because of fork failure
hush: rename functions: xxx_real -> xxx
hush: try to add a bit more of vfork-friendliness
hush: add rudimentary design docs
hush: add TODO (newly discovered bug with globbing)
Diffstat (limited to 'shell/hush_doc.txt')
-rw-r--r-- | shell/hush_doc.txt | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/shell/hush_doc.txt b/shell/hush_doc.txt new file mode 100644 index 000000000..a3ead590c --- /dev/null +++ b/shell/hush_doc.txt | |||
@@ -0,0 +1,39 @@ | |||
1 | This is how hush runs commands: | ||
2 | |||
3 | /* callsite: process_command_subs */ | ||
4 | generate_stream_from_list(struct pipe *head) - handles `cmds` | ||
5 | create UNIX pipe | ||
6 | [v]fork | ||
7 | child: | ||
8 | redirect pipe output to stdout | ||
9 | _exit(run_list(head)); /* leaks memory */ | ||
10 | parent: | ||
11 | return UNIX pipe's output fd | ||
12 | /* head is freed by the caller */ | ||
13 | |||
14 | /* callsite: parse_and_run_stream */ | ||
15 | run_and_free_list(struct pipe *) | ||
16 | run_list(struct pipe *) | ||
17 | free_pipe_list(struct pipe *) | ||
18 | |||
19 | /* callsites: generate_stream_from_list, run_and_free_list, pseudo_exec, run_pipe */ | ||
20 | run_list(struct pipe *) - handles "cmd; cmd2 && cmd3", while/for/do loops | ||
21 | run_pipe - for every pipe in list | ||
22 | |||
23 | /* callsite: run_list */ | ||
24 | run_pipe - runs "cmd1 | cmd2 | cmd3 [&]" | ||
25 | run_list - used if only one cmd and it is of the form "{ cmd4; cmd5 && cmd6; }" | ||
26 | forks for every cmd if more than one cmd or if & is there | ||
27 | pseudo_exec - runs each "cmdN" (handles builtins etc) | ||
28 | |||
29 | /* callsite: run_pipe_real */ | ||
30 | pseudo_exec - runs "cmd" (handles builtins etc) | ||
31 | exec - execs external programs | ||
32 | run_list - used if cmdN is "(cmds)" or "{cmds;}" | ||
33 | /* problem: putenv's malloced strings into environ - | ||
34 | ** with vfork they will leak into parent process | ||
35 | */ | ||
36 | /* problem with ENABLE_FEATURE_SH_STANDALONE: | ||
37 | ** run_applet_no_and_exit(a, argv) uses exit - this can interfere | ||
38 | ** with vfork - switch to _exit there? | ||
39 | */ | ||