| 1354 | } |
| 1355 | |
| 1356 | void |
| 1357 | proc_add_orphan(struct proc *child, struct proc *parent) |
| 1358 | { |
| 1359 | |
| 1360 | sx_assert(&proctree_lock, SX_XLOCKED); |
| 1361 | KASSERT((child->p_flag & P_TRACED) != 0, |
| 1362 | ("proc_add_orphan: not traced")); |
| 1363 | |
| 1364 | if (LIST_EMPTY(&parent->p_orphans)) { |
| 1365 | child->p_treeflag |= P_TREE_FIRST_ORPHAN; |
| 1366 | LIST_INSERT_HEAD(&parent->p_orphans, child, p_orphan); |
| 1367 | } else { |
| 1368 | LIST_INSERT_AFTER(LIST_FIRST(&parent->p_orphans), |
| 1369 | child, p_orphan); |
| 1370 | } |
| 1371 | child->p_treeflag |= P_TREE_ORPHANED; |
| 1372 | } |
| 1373 | |
| 1374 | /* |
| 1375 | * Make process 'parent' the new parent of process 'child'. |
no outgoing calls
no test coverage detected