Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_fork.c
Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | p2->p_reaper = (p1->p_treeflag & P_TREE_REAPER) != 0 ? | ||||
p1 : p1->p_reaper; | p1 : p1->p_reaper; | ||||
pptr = p1; | pptr = p1; | ||||
} | } | ||||
p2->p_pptr = pptr; | p2->p_pptr = pptr; | ||||
p2->p_oppid = pptr->p_pid; | p2->p_oppid = pptr->p_pid; | ||||
LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); | LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); | ||||
LIST_INIT(&p2->p_reaplist); | LIST_INIT(&p2->p_reaplist); | ||||
LIST_INSERT_HEAD(&p2->p_reaper->p_reaplist, p2, p_reapsibling); | LIST_INSERT_HEAD(&p2->p_reaper->p_reaplist, p2, p_reapsibling); | ||||
if (p2->p_reaper == p1 && p1 != initproc) { | if (p2->p_reaper == p1) { | ||||
p2->p_reapsubtree = p2->p_pid; | p2->p_reapsubtree = p2->p_pid; | ||||
proc_id_set_cond(PROC_ID_REAP, p2->p_pid); | proc_id_set_cond(PROC_ID_REAP, p2->p_pid); | ||||
} | } | ||||
sx_xunlock(&proctree_lock); | sx_xunlock(&proctree_lock); | ||||
/* Inform accounting that we have forked. */ | /* Inform accounting that we have forked. */ | ||||
p2->p_acflag = AFORK; | p2->p_acflag = AFORK; | ||||
PROC_UNLOCK(p2); | PROC_UNLOCK(p2); | ||||
▲ Show 20 Lines • Show All 515 Lines • Show Last 20 Lines |