| 3341 | } |
| 3342 | |
| 3343 | static void |
| 3344 | childproc_jobstate(struct proc *p, int reason, int sig) |
| 3345 | { |
| 3346 | struct sigacts *ps; |
| 3347 | |
| 3348 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 3349 | PROC_LOCK_ASSERT(p->p_pptr, MA_OWNED); |
| 3350 | |
| 3351 | /* |
| 3352 | * Wake up parent sleeping in kern_wait(), also send |
| 3353 | * SIGCHLD to parent, but SIGCHLD does not guarantee |
| 3354 | * that parent will awake, because parent may masked |
| 3355 | * the signal. |
| 3356 | */ |
| 3357 | p->p_pptr->p_flag |= P_STATCHILD; |
| 3358 | wakeup(p->p_pptr); |
| 3359 | |
| 3360 | ps = p->p_pptr->p_sigacts; |
| 3361 | mtx_lock(&ps->ps_mtx); |
| 3362 | if ((ps->ps_flag & PS_NOCLDSTOP) == 0) { |
| 3363 | mtx_unlock(&ps->ps_mtx); |
| 3364 | sigparent(p, reason, sig); |
| 3365 | } else |
| 3366 | mtx_unlock(&ps->ps_mtx); |
| 3367 | } |
| 3368 | |
| 3369 | void |
| 3370 | childproc_stopped(struct proc *p, int reason) |
no test coverage detected