Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_fork.c
Show First 20 Lines • Show All 721 Lines • ▼ Show 20 Lines | if ((p1->p_ptevents & PTRACE_FORK) != 0) { | ||||
if ((p1->p_ptevents & PTRACE_FORK) != 0) { | if ((p1->p_ptevents & PTRACE_FORK) != 0) { | ||||
/* | /* | ||||
* Arrange for debugger to receive the fork event. | * Arrange for debugger to receive the fork event. | ||||
* | * | ||||
* We can report PL_FLAG_FORKED regardless of | * We can report PL_FLAG_FORKED regardless of | ||||
* P_FOLLOWFORK settings, but it does not make a sense | * P_FOLLOWFORK settings, but it does not make a sense | ||||
* for runaway child. | * for runaway child. | ||||
*/ | */ | ||||
thread_lock(td); | |||||
td->td_flags |= TDF_ASTPENDING; | |||||
thread_unlock(td); | |||||
td->td_dbgflags |= TDB_FORK; | td->td_dbgflags |= TDB_FORK; | ||||
td->td_dbg_forked = p2->p_pid; | td->td_dbg_forked = p2->p_pid; | ||||
td2->td_dbgflags |= TDB_STOPATFORK; | td2->td_dbgflags |= TDB_STOPATFORK; | ||||
proc_set_traced(p2, true); | proc_set_traced(p2, true); | ||||
CTR2(KTR_PTRACE, | CTR2(KTR_PTRACE, | ||||
"do_fork: attaching to new child pid %d: oppid %d", | "do_fork: attaching to new child pid %d: oppid %d", | ||||
p2->p_pid, p2->p_oppid); | p2->p_pid, p2->p_oppid); | ||||
proc_reparent(p2, p1->p_pptr, false); | proc_reparent(p2, p1->p_pptr, false); | ||||
▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines |