diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-19 20:08:19 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-19 20:08:19 +0000 |
commit | d1801a44301ae10910763de860614b1aed9922d7 (patch) | |
tree | 1ff6d98e68b57bb1539321b992fb389652c3f98b /shell | |
parent | 9ace613406968c1f64b08f6869e51c321557f106 (diff) | |
download | busybox-w32-d1801a44301ae10910763de860614b1aed9922d7.tar.gz busybox-w32-d1801a44301ae10910763de860614b1aed9922d7.tar.bz2 busybox-w32-d1801a44301ae10910763de860614b1aed9922d7.zip |
dd: fix skip= parse error (spotted by Dirk Clemens <develop@cle-mens.de>)
Diffstat (limited to 'shell')
-rw-r--r-- | shell/README.job | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/shell/README.job b/shell/README.job index b29d31588..7e262b489 100644 --- a/shell/README.job +++ b/shell/README.job | |||
@@ -2,8 +2,12 @@ strace of "sleep 1 | sleep 2" being run from interactive bash 3.0 | |||
2 | 2 | ||
3 | 3 | ||
4 | Synopsis: | 4 | Synopsis: |
5 | open /dev/tty [, if fails, open ttyname(0)]; close /* helps re-establish ctty */ | ||
5 | get current signal mask | 6 | get current signal mask |
6 | install default handlers for GHLD QUIT TERM | 7 | TCGETS on fd# 0 |
8 | TCGETS on fd# 2 /* NB: if returns ENOTTY (2>/dev/null), sh seems to disable job control, | ||
9 | does not show prompt, but still executes cmds from fd# 0 */ | ||
10 | install default handlers for CHLD QUIT TERM | ||
7 | install common handler for HUP INT ILL TRAP ABRT FPE BUS SEGV SYS PIPE ALRM TERM XCPU XFSZ VTALRM USR1 USR2 | 11 | install common handler for HUP INT ILL TRAP ABRT FPE BUS SEGV SYS PIPE ALRM TERM XCPU XFSZ VTALRM USR1 USR2 |
8 | ignore QUIT | 12 | ignore QUIT |
9 | install handler for INT | 13 | install handler for INT |
@@ -34,11 +38,73 @@ get our pprocess group | |||
34 | signal followed by a SIGCONT signal will be sent to each process | 38 | signal followed by a SIGCONT signal will be sent to each process |
35 | in the newly-orphaned process group. | 39 | in the newly-orphaned process group. |
36 | ... | 40 | ... |
37 | 41 | dup stderr to fd# 255 | |
42 | move ourself to our own process group | ||
43 | block CHLD TSTP TTIN TTOU | ||
44 | set tty's (255, stderr's) foreground process group to our group | ||
45 | allow all signals | ||
46 | mark 255 CLOEXEC | ||
47 | set CHLD handler | ||
48 | get signal mask | ||
49 | get fd#0 flags | ||
50 | get signal mask | ||
51 | set INT handler | ||
52 | block CHLD TSTP TTIN TTOU | ||
53 | set fd #255 foreground process group to our group | ||
54 | allow all signals | ||
55 | set INT handler | ||
56 | block all signals | ||
57 | allow all signals | ||
58 | block INT | ||
59 | allow all signals | ||
60 | lotsa sigactions: set INT,ALRM,WINCH handlers, ignore TERM,QUIT,TSTP,TTOU,TTIN | ||
61 | block all signals | ||
62 | allow all signals | ||
63 | block all signals | ||
64 | allow all signals | ||
65 | block all signals | ||
66 | allow all signals | ||
67 | read "sleep 1 | sleep 2\n" | ||
68 | block INT | ||
69 | TCSETSW on fd# 0 | ||
70 | allow all signals | ||
71 | lotsa sigactions: set INT,ALRM,WINCH handlers, ignore TERM,QUIT,TSTP,TTOU,TTIN | ||
72 | block CHLD | ||
73 | pipe([4, 5]) /* oops seems I lost another pipe() in editing... */ | ||
74 | fork child #1 | ||
75 | put child in it's own process group | ||
76 | block only CHLD | ||
77 | close(5) | ||
78 | block only INT CHLD | ||
79 | fork child #2 | ||
80 | put child in the same process group as first one | ||
81 | block only CHLD | ||
82 | close(4) | ||
83 | block only CHLD | ||
84 | block only CHLD TSTP TTIN TTOU | ||
85 | set fd# 255 foreground process group to first child's one | ||
86 | block only CHLD | ||
87 | block only CHLD | ||
88 | block only CHLD | ||
89 | wait4 for children to die or stop - first child exits | ||
90 | wait4 for children to die or stop - second child exits | ||
91 | block CHLD TSTP TTIN TTOU | ||
92 | set fd# 255 foreground process group to our own one | ||
93 | block only CHLD | ||
94 | block only CHLD | ||
95 | block nothing | ||
96 | --- SIGCHLD (Child exited) @ 0 (0) --- | ||
97 | wait for it - no child (already waited for) | ||
98 | sigreturn() | ||
99 | read signal mask | ||
100 | lotsa sigactions... | ||
101 | read next command | ||
38 | 102 | ||
39 | 103 | ||
40 | execve("/bin/sh", ["sh"], [/* 34 vars */]) = 0 | 104 | execve("/bin/sh", ["sh"], [/* 34 vars */]) = 0 |
41 | rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 | 105 | rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 |
106 | ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 | ||
107 | ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 | ||
42 | rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0 | 108 | rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0 |
43 | rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0 | 109 | rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0 |
44 | rt_sigaction(SIGTERM, {SIG_DFL}, {SIG_DFL}, 8) = 0 | 110 | rt_sigaction(SIGTERM, {SIG_DFL}, {SIG_DFL}, 8) = 0 |