| 662 | } |
| 663 | |
| 664 | static struct proc * |
| 665 | jobc_reaper(struct proc *p) |
| 666 | { |
| 667 | struct proc *pp; |
| 668 | |
| 669 | sx_assert(&proctree_lock, SA_LOCKED); |
| 670 | |
| 671 | for (pp = p;;) { |
| 672 | pp = pp->p_reaper; |
| 673 | if (pp->p_reaper == pp || |
| 674 | (pp->p_treeflag & P_TREE_GRPEXITED) == 0) |
| 675 | return (pp); |
| 676 | } |
| 677 | } |
| 678 | |
| 679 | static struct proc * |
| 680 | jobc_parent(struct proc *p, struct proc *p_exiting) |