tcsh being dodgy, or pipe code ishoos?
John-Mark Gurney
gurney_j at efn.org
Wed Jun 25 10:27:49 PDT 2003
Tim Kientzle wrote this message on Wed, Jun 25, 2003 at 09:51 -0700:
[...]
> >Say the shell you run the above command is 10. It will fork to create
> >a shell to run the commands in the outter parens. Call this 11. 11's
> >job is to run: (echo 2; echo 3) | ./xargs -I% echo +%
> >11 will fork/exec and run: echo 2; echo 3 creating process 12. 11
> >will see that there is no additional commands after ./xargs, and
> >exec (not fork) xargs. Since 12 is stil around and a child of 11,
> >when it exits, 11 will reap 12, and thinking that the first proccess
> >has exited, run the second echo command. Due to scheduling, we'll
> >have two processes running at the same time which can cause the
> >interleaving of data.
[...]
> Fixing the shell would also be desirable, as Terry points
> out, though it does involve removing a nice optimization.
> Why do exec-ed processes inherit the children of the former
> process, anyway? That doesn't entirely sound right to me.
> Is that behavior mandated by some standard? If not, this
> could arguably be considered a kernel bug. Hmmm...
Could someone look into this for me? I don't have any of the standards
document. Hmmm. does APUE even talk about this? It's more of a question
if exec'd processes inherit children.
hmm.
--
John-Mark Gurney Voice: +1 415 225 5579
"All that I will do, has been done, All that I have, has not."
More information about the freebsd-current
mailing list