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

Function proc_realparent

freebsd/kern/kern_exit.c:102–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100SDT_PROBE_DEFINE1(proc, , , exit, "int");
101
102struct proc *
103proc_realparent(struct proc *child)
104{
105 struct proc *p, *parent;
106
107 sx_assert(&proctree_lock, SX_LOCKED);
108 if ((child->p_treeflag & P_TREE_ORPHANED) == 0)
109 return (child->p_pptr->p_pid == child->p_oppid ?
110 child->p_pptr : child->p_reaper);
111 for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) {
112 /* Cannot use LIST_PREV(), since the list head is not known. */
113 p = __containerof(p->p_orphan.le_prev, struct proc,
114 p_orphan.le_next);
115 KASSERT((p->p_treeflag & P_TREE_ORPHANED) != 0,
116 ("missing P_ORPHAN %p", p));
117 }
118 parent = __containerof(p->p_orphan.le_prev, struct proc,
119 p_orphans.lh_first);
120 return (parent);
121}
122
123void
124reaper_abandon_children(struct proc *p, bool exiting)

Callers 7

inferiorFunction · 0.85
jobc_parentFunction · 0.85
reap_statusFunction · 0.85
reap_getpidsFunction · 0.85
kern_ptraceFunction · 0.85
exit1Function · 0.85
proc_reapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected