* When a process descriptor is reaped, perhaps as a result of close() or * pdwait4(), release the process's reference on the process descriptor. */
| 328 | * pdwait4(), release the process's reference on the process descriptor. |
| 329 | */ |
| 330 | void |
| 331 | procdesc_reap(struct proc *p) |
| 332 | { |
| 333 | struct procdesc *pd; |
| 334 | |
| 335 | sx_assert(&proctree_lock, SA_XLOCKED); |
| 336 | KASSERT(p->p_procdesc != NULL, ("procdesc_reap: p_procdesc == NULL")); |
| 337 | |
| 338 | pd = p->p_procdesc; |
| 339 | pd->pd_proc = NULL; |
| 340 | p->p_procdesc = NULL; |
| 341 | procdesc_free(pd); |
| 342 | } |
| 343 | |
| 344 | /* |
| 345 | * procdesc_close() - last close on a process descriptor. If the process is |
no test coverage detected