• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..16-Jun-201446

ash.cH A D25-Feb-2014270.8 KiB

ash_test/H16-Jun-201410

bbsh.cH A D25-Feb-20145 KiB

Config.inH A D25-Feb-20149 KiB

cttyhack.cH A D25-Feb-20141.7 KiB

hush.cH A D25-Feb-2014104 KiB

hush_test/H16-Jun-20148

KbuildH A D25-Feb-2014322

lash.cH A D25-Feb-201439 KiB

msh.cH A D25-Feb-201499.3 KiB

READMEH A D25-Feb-20143.8 KiB

README.jobH A D25-Feb-201416.2 KiB

susv3_doc.tar.bz2H A D25-Feb-201469.8 KiB

README

1Various bits of what is known about busybox shells, in no particular order.
2
32007-06-13
4hush: exec <"$1" doesn't do parameter subst
5
62007-05-24
7hush: environment-related memory leak plugged, with net code size
8decrease.
9
102007-05-24
11hush: '( echo ${name )' will show syntax error message, but prompt
12doesn't return (need to press <enter>). Pressing Ctrl-C, <enter>,
13'( echo ${name )' again, Ctrl-C segfaults.
14
152007-05-21
16hush: environment cannot be handled by libc routines as they are leaky
17(by API design and thus unfixable): hush will leak memory in this script,
18bash does not:
19pid=$$
20while true; do
21    unset t;
22    t=111111111111111111111111111111111111111111111111111111111111111111111111
23    export t
24    ps -o vsz,pid,comm | grep " $pid "
25done
26The fix is to not use setenv/putenv/unsetenv but manipulate env ourself. TODO.
27hush: meanwhile, first three command subst bugs mentioned below are fixed. :)
28
292007-05-06
30hush: more bugs spotted. Comparison with bash:
31bash-3.2# echo "TEST`date;echo;echo`BEST"
32TESTSun May  6 09:21:05 CEST 2007BEST         [we dont strip eols]
33bash-3.2# echo "TEST`echo '$(echo ZZ)'`BEST"
34TEST$(echo ZZ)BEST                            [we execute inner echo]
35bash-3.2# echo "TEST`echo "'"`BEST"
36TEST'BEST                                     [we totally mess up this one]
37bash-3.2# echo `sleep 5`
38[Ctrl-C should work, Ctrl-Z should do nothing][we totally mess up this one]
39bash-3.2# if true; then
40> [Ctrl-C]
41bash-3.2#                                     [we re-issue "> "]
42bash-3.2# if echo `sleep 5`; then
43> true; fi                                    [we execute sleep before "> "]
44
452007-05-04
46hush: made ctrl-Z/C work correctly for "while true; do true; done"
47(namely, it backgrounds/interrupts entire "while")
48
492007-05-03
50hush: new bug spotted: Ctrl-C on "while true; do true; done" doesn't
51work right:
52# while true; do true; done
53[1] 0 true <-- pressing Ctrl-C several times...
54[2] 0 true
55[3] 0 true
56Segmentation fault
57
582007-05-03
59hush: update on "sleep 1 | exit 3; echo $?" bug.
60parse_stream_outer() repeatedly calls parse_stream().
61parse_stream() is now fixed to stop on ';' in this example,
62fixing it (parse_stream_outer() will call parse_stream() 1st time,
63execute the parse tree, call parse_stream() 2nd time and execute the tree).
64But it's not the end of story.
65In more complex situations we _must_ parse way farther before executing.
66Example #2: "{ sleep 1 | exit 3; echo $?; ...few_lines... } >file".
67Because of redirection, we cannot execute 1st pipe before we parse it all.
68We probably need to learn to store $var expressions in parse tree.
69Debug printing of parse tree would be nice too.
70
712007-04-28
72hush: Ctrl-C and Ctrl-Z for single NOFORK commands are working.
73Memory and other resource leaks (opendir) are not addressed
74(testcase is "rm -i" interrupted by ctrl-c).
75
762007-04-21
77hush: "sleep 5 | sleep 6" + Ctrl-Z + fg seems to work.
78"rm -i" + Ctrl-C, "sleep 5" + Ctrl-Z still doesn't work
79for SH_STANDALONE case :(
80
812007-04-21
82hush: fixed non-backgrounding of "sleep 1 &" and totally broken
83"sleep 1 | sleep 2 &". Noticed a bug where successive jobs
84get numbers 1,2,3 even when job #1 has exited before job# 2 is started.
85(bash reuses #1 in this case)
86
872007-04-21
88hush: "sleep 1 | exit 3; echo $?" prints 0 because $? is substituted
89_before_ pipe gets executed!! run_list_real() already has "pipe;echo"
90parsed and handed to it for execution, so it sees "pipe"; "echo 0".
91
922007-04-21
93hush: removed setsid() and made job control sort-of-sometimes-work.
94Ctrl-C in "rm -i" works now except for SH_STANDALONE case.
95"sleep 1 | exit 3" + "echo $?" works, "sleep 1 | exit 3; echo $?"
96shows exitcode 0 (should be 3). "sleep 1 | sleep 2 &" fails horribly.
97
982007-04-14
99lash, hush: both do setsid() and as a result don't have ctty!
100Ctrl-C doesn't work for any child (try rm -i), etc...
101lash: bare ">file" doesn't create a file (hush works)
102

README.job

1strace of "sleep 1 | sleep 2" being run from interactive bash 3.0
2
3
4Synopsis:
5open /dev/tty [, if fails, open ttyname(0)]; close /* helps re-establish ctty */
6get current signal mask
7TCGETS on fd# 0
8TCGETS 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 */
10install default handlers for CHLD QUIT TERM
11install common handler for HUP INT ILL TRAP ABRT FPE BUS SEGV SYS PIPE ALRM TERM XCPU XFSZ VTALRM USR1 USR2
12ignore QUIT
13install handler for INT
14ignore TERM
15install handler for INT
16ignore TSTP TTOU TTIN
17install handler for WINCH
18get pid, ppid
19block all signals
20unblock all signals
21get our pprocess group
22    minidoc:
23    Each process group is a member of a session and each process is a member
24    of the session of which its process group is a member.
25    Process groups are used for distribution of signals, and by terminals
26    to arbitrate requests for their input: processes that have the same
27    process group as the terminal are foreground and may read, while others
28    will block with a signal if they attempt to read.  These calls are thus used
29    by programs (shells) to create process groups in implementing job control.
30    The TIOCGPGRP and TIOCSPGRP calls described in termios(3) are used to get/set
31    the process group of the control terminal.
32    If a session has a controlling terminal, CLOCAL is not set and a hangup occurs,
33    then the session leader is sent a SIGHUP.  If the session leader exits,
34    the SIGHUP signal will be sent to each process in the foreground process
35    group of the controlling terminal.
36    If the exit of the process causes a process group to become orphaned,
37    and if any member of the newly-orphaned process group is stopped, then a SIGHUP
38    signal followed by a SIGCONT signal will be sent to each process
39    in the newly-orphaned process group.
40...
41dup stderr to fd# 255
42move ourself to our own process group
43block CHLD TSTP TTIN TTOU
44set tty's (255, stderr's) foreground process group to our group
45allow all signals
46mark 255 CLOEXEC
47set CHLD handler
48get signal mask
49get fd#0 flags
50get signal mask
51set INT handler
52block CHLD TSTP TTIN TTOU
53set fd #255 foreground process group to our group
54allow all signals
55set INT handler
56block all signals
57allow all signals
58block INT
59allow all signals
60lotsa sigactions: set INT,ALRM,WINCH handlers, ignore TERM,QUIT,TSTP,TTOU,TTIN
61block all signals
62allow all signals
63block all signals
64allow all signals
65block all signals
66allow all signals
67read "sleep 1 | sleep 2\n"
68block INT
69TCSETSW on fd# 0
70allow all signals
71lotsa sigactions: set INT,ALRM,WINCH handlers, ignore TERM,QUIT,TSTP,TTOU,TTIN
72block CHLD
73pipe([4, 5])  /* oops seems I lost another pipe() in editing... */
74fork child #1
75put child in it's own process group
76block only CHLD
77close(5)
78block only INT CHLD
79fork child #2
80put child in the same process group as first one
81block only CHLD
82close(4)
83block only CHLD
84block only CHLD TSTP TTIN TTOU
85set fd# 255 foreground process group to first child's one
86block only CHLD
87block only CHLD
88block only CHLD
89/* note: because shell is not in foreground now, e.g. Ctrl-C will send INT to children only! */
90wait4 for children to die or stop - first child exits
91wait4 for children to die or stop - second child exits
92block CHLD TSTP TTIN TTOU
93set fd# 255 foreground process group to our own one
94block only CHLD
95block only CHLD
96block nothing
97--- SIGCHLD (Child exited) @ 0 (0) ---
98    wait for it - no child (already waited for)
99    sigreturn()
100read signal mask
101lotsa sigactions...
102read next command
103
104
105execve("/bin/sh", ["sh"], [/* 34 vars */]) = 0
106rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
107ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
108ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
109rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
110rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
111rt_sigaction(SIGTERM, {SIG_DFL}, {SIG_DFL}, 8) = 0
112rt_sigaction(SIGHUP, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
113rt_sigaction(SIGINT, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
114rt_sigaction(SIGILL, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
115rt_sigaction(SIGTRAP, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
116rt_sigaction(SIGABRT, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
117rt_sigaction(SIGFPE, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
118rt_sigaction(SIGBUS, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
119rt_sigaction(SIGSEGV, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
120rt_sigaction(SIGSYS, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
121rt_sigaction(SIGPIPE, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
122rt_sigaction(SIGALRM, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
123rt_sigaction(SIGTERM, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
124rt_sigaction(SIGXCPU, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
125rt_sigaction(SIGXFSZ, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
126rt_sigaction(SIGVTALRM, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
127rt_sigaction(SIGUSR1, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
128rt_sigaction(SIGUSR2, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
129rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
130rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
131rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
132rt_sigaction(SIGTERM, {SIG_IGN}, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
133rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
134rt_sigaction(SIGTSTP, {SIG_IGN}, {SIG_DFL}, 8) = 0
135rt_sigaction(SIGTTOU, {SIG_IGN}, {SIG_DFL}, 8) = 0
136rt_sigaction(SIGTTIN, {SIG_IGN}, {SIG_DFL}, 8) = 0
137rt_sigaction(SIGWINCH, {0x807dc33, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
138getpid()                = 19473
139getppid()               = 19472
140rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
141rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
142getpgrp()               = 1865
143dup(2)                  = 4
144fcntl64(255, F_GETFD)   = -1 EBADF (Bad file descriptor)
145dup2(4, 255)            = 255
146close(4)                = 0
147ioctl(255, TIOCGPGRP, [1865]) = 0
148getpid()                = 19473
149setpgid(0, 19473)       = 0
150rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
151ioctl(255, TIOCSPGRP, [19473]) = 0
152rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
153fcntl64(255, F_SETFD, FD_CLOEXEC) = 0
154rt_sigaction(SIGCHLD, {0x807c922, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_DFL}, 8) = 0
155rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
156fcntl64(0, F_GETFL)     = 0x2 (flags O_RDWR)
157...
158rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
159rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
160rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
161ioctl(255, TIOCSPGRP, [19473]) = 0
162rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
163rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
164rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
165rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
166rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
167rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
168rt_sigaction(SIGINT, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
169rt_sigaction(SIGTERM, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
170rt_sigaction(SIGTERM, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
171rt_sigaction(SIGQUIT, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
172rt_sigaction(SIGQUIT, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
173rt_sigaction(SIGALRM, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
174rt_sigaction(SIGTSTP, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
175rt_sigaction(SIGTSTP, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
176rt_sigaction(SIGTTOU, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
177rt_sigaction(SIGTTOU, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
178rt_sigaction(SIGTTIN, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
179rt_sigaction(SIGTTIN, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
180rt_sigaction(SIGWINCH, {0x80ca5cd, [], SA_RESTORER|SA_RESTART, 0x6ff7a4f8}, {0x807dc33, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
181rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
182rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
183rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
184rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
185rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
186rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
187write(2, "sh-3.00# ", 9) = 9
188rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
189read(0, "s", 1)         = 1
190write(2, "s", 1)        = 1
191rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
192read(0, "l", 1)         = 1
193write(2, "l", 1)        = 1
194rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
195... rest of "sleep 1 | sleep 2" entered...
196rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
197read(0, "2", 1)         = 1
198write(2, "2", 1)        = 1
199rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
200read(0, "\r", 1)        = 1
201write(2, "\n", 1)       = 1
202rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
203ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
204rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
205rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
206rt_sigaction(SIGTERM, {SIG_IGN}, {SIG_IGN}, 8) = 0
207rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_IGN}, 8) = 0
208rt_sigaction(SIGALRM, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
209rt_sigaction(SIGTSTP, {SIG_IGN}, {SIG_IGN}, 8) = 0
210rt_sigaction(SIGTTOU, {SIG_IGN}, {SIG_IGN}, 8) = 0
211rt_sigaction(SIGTTIN, {SIG_IGN}, {SIG_IGN}, 8) = 0
212rt_sigaction(SIGWINCH, {0x807dc33, [], SA_RESTORER, 0x6ff7a4f8}, {0x80ca5cd, [], SA_RESTORER|SA_RESTART, 0x6ff7a4f8}, 8) = 0
213rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
214rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
215pipe([4, 5])            = 0
216rt_sigprocmask(SIG_BLOCK, [INT CHLD], [CHLD], 8) = 0
217fork()                  = 19755
218setpgid(19755, 19755)                = 0
219rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
220close(5)                = 0
221rt_sigprocmask(SIG_BLOCK, [INT CHLD], [CHLD], 8) = 0
222fork()                  = 19756
223setpgid(19756, 19755)   = 0
224rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
225close(4)                = 0
226rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
227rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [CHLD], 8) = 0
228ioctl(255, TIOCSPGRP, [19755]) = 0
229rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
230rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
231rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
232wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WUNTRACED, NULL) = 19755
233wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WUNTRACED, NULL) = 19756
234rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [CHLD], 8) = 0
235ioctl(255, TIOCSPGRP, [19473]) = 0
236rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
237rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0
238rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
239--- SIGCHLD (Child exited) @ 0 (0) ---
240wait4(-1, 0x77fc9c54, WNOHANG|WUNTRACED, NULL) = -1 ECHILD (No child processes)
241sigreturn()             = ? (mask now [])
242rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
243rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
244rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
245ioctl(255, TIOCSPGRP, [19473]) = 0
246rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
247rt_sigaction(SIGINT, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
248rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0
249rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
250rt_sigaction(SIGINT, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
251rt_sigaction(SIGTERM, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
252rt_sigaction(SIGTERM, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
253rt_sigaction(SIGQUIT, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
254rt_sigaction(SIGQUIT, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
255rt_sigaction(SIGALRM, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {0x808f752, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
256rt_sigaction(SIGTSTP, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
257rt_sigaction(SIGTSTP, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
258rt_sigaction(SIGTTOU, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
259rt_sigaction(SIGTTOU, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
260rt_sigaction(SIGTTIN, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, {SIG_IGN}, 8) = 0
261rt_sigaction(SIGTTIN, {SIG_IGN}, {0x80ca530, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
262rt_sigaction(SIGWINCH, {0x80ca5cd, [], SA_RESTORER|SA_RESTART, 0x6ff7a4f8}, {0x807dc33, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
263write(2, "sh-3.00# ", 9) = 9
264
265
266getpid() = 19755
267rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
268rt_sigaction(SIGTSTP, {SIG_DFL}, {SIG_IGN}, 8)    = 0
269rt_sigaction(SIGTTIN, {SIG_DFL}, {SIG_IGN}, 8) = 0
270rt_sigaction(SIGTTOU, {SIG_DFL}, {SIG_IGN}, 8) = 0
271setpgid(19755, 19755) = 0
272rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
273ioctl(255, TIOCSPGRP, [19755]) = 0
274rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
275close(4)   = 0
276dup2(5, 1) = 1
277close(5)              = 0
278rt_sigaction(SIGINT, {SIG_DFL}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
279rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_IGN}, 8) = 0
280rt_sigaction(SIGTERM, {SIG_DFL}, {SIG_IGN}, 8) = 0
281rt_sigaction(SIGCHLD, {SIG_DFL}, {0x807c922, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
282execve("/bin/sleep", ["sleep", "1"], [/* 34 vars */]) = 0
283...
284_exit(0)                = ?
285
286
287getpid() = 19756
288rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
289rt_sigaction(SIGTSTP, {SIG_DFL}, {SIG_IGN}, 8) = 0
290rt_sigaction(SIGTTIN, {SIG_DFL}, {SIG_IGN}, 8) = 0
291rt_sigaction(SIGTTOU, {SIG_DFL}, {SIG_IGN}, 8) = 0
292setpgid(19756, 19755) = 0
293rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
294ioctl(255, TIOCSPGRP, [19755]) = 0
295rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
296dup2(4, 0) = 0
297close(4) = 0
298rt_sigaction(SIGINT, {SIG_DFL}, {0x808f7d7, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
299rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_IGN}, 8) = 0
300rt_sigaction(SIGTERM, {SIG_DFL}, {SIG_IGN}, 8) = 0
301rt_sigaction(SIGCHLD, {SIG_DFL}, {0x807c922, [], SA_RESTORER, 0x6ff7a4f8}, 8) = 0
302execve("/bin/sleep", ["sleep", "2"], [/* 34 vars */]) = 0
303...
304_exit(0)                = ?
305