MCPcopy Create free account
hub / github.com/F-Stack/f-stack / proc_add_orphan

Function proc_add_orphan

freebsd/kern/kern_exit.c:1356–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1354}
1355
1356void
1357proc_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'.

Callers 2

proc_reparentFunction · 0.85
procdesc_closeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected