busybox/shell/README.job
<<
>>
Prefs
   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