On Wed, Apr 25, 2012 at 4:06 PM, erik quanstrom <quans...@quanstro.net> wrote: > good point. procrfork() does nowait. but then how do i get > a wait message. i'm really hoping the answer is not "you don't".
I don't believe you have looked at the context here. This is only used by procexec, which is trying to simulate an exec replacing a proc. It does that by setting p->needexec=1 and jumping back into the scheduler. The scheduler will call _schedexec, which does an rfork of its own (not procrfork), the "exec"ed program runs in the child, and the parent waits for the wait message saying the child is done. An unexpected wait message shold not come in, but if one does, might as well be tidy and free it before continuing the loop. This is not Linux. Each individual proc (thread) has its own set of children, so the only wait message that should arrive on that proc is the one it expects. Other procexecs running in other procs will not affect it. Russ