I
Ilya Zakharevich
I'm starting a kid, kid writes something to TTY (which is explicitely
opened in the kid). The kid also writes something to a pipe open()ed
to a parent.
parent closes the pipe opened to the kid (opened via
open F, "@kid_cmd 2>&1 |"...
). My assumption is that at this moment, all the traces of kid
existence should disappear.
However, what I observe is that the kid's output to TTY is
interdispersed with output from the next kid, and is interdispersed
with output to TTY from the parent. (Parent does not open TTY, it
just writes to STDERR which happens to be TTY.)
It looks like the output of kid is somehow "stuck" in a TTY (and it
writes whole lines!) for some time after the kid terminates. (Doing
`sleep 1' in a parent IS a workaround...)
The system is
Linux foo 2.6.18-194.3.1.el5PAE #1 SMP Thu May 13 13:48:44 TZ 2010
i686 athlon i386 GNU/Linux
Is it expected somehow?
Thanks,
Ilya
P.S. Test script is available, but it is somewhat convoluted since I
was testing for some OTHER problems. ;-) :-(
opened in the kid). The kid also writes something to a pipe open()ed
to a parent.
parent closes the pipe opened to the kid (opened via
open F, "@kid_cmd 2>&1 |"...
). My assumption is that at this moment, all the traces of kid
existence should disappear.
However, what I observe is that the kid's output to TTY is
interdispersed with output from the next kid, and is interdispersed
with output to TTY from the parent. (Parent does not open TTY, it
just writes to STDERR which happens to be TTY.)
It looks like the output of kid is somehow "stuck" in a TTY (and it
writes whole lines!) for some time after the kid terminates. (Doing
`sleep 1' in a parent IS a workaround...)
The system is
Linux foo 2.6.18-194.3.1.el5PAE #1 SMP Thu May 13 13:48:44 TZ 2010
i686 athlon i386 GNU/Linux
Is it expected somehow?
Thanks,
Ilya
P.S. Test script is available, but it is somewhat convoluted since I
was testing for some OTHER problems. ;-) :-(