3
0

README.job 16 KB

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