Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_fork.c
| Show First 20 Lines • Show All 819 Lines • ▼ Show 20 Lines | if ((p1->p_ptevents & PTRACE_FORK) != 0) { | |||||||||
| "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); | |||||||||
| } | } | |||||||||
| PROC_UNLOCK(p2); | PROC_UNLOCK(p2); | |||||||||
| sx_xunlock(&proctree_lock); | sx_xunlock(&proctree_lock); | |||||||||
| } | } | |||||||||
| /* | ||||||||||
| * Activate procdesc NOTE_FORK after we attached the debugger | ||||||||||
| * to the child. This guarantees that a debugger which does | ||||||||||
markjUnsubmitted Done Inline Actions
markj: | ||||||||||
| * kevent() on the process descriptor to get notifications of | ||||||||||
| * fork events, can properly observe the child right after the | ||||||||||
Done Inline Actions
markj: | ||||||||||
| * notification fired. | ||||||||||
Done Inline Actions
markj: | ||||||||||
| */ | ||||||||||
| procdesc_fork(p1, p2->p_pid); | ||||||||||
| racct_proc_fork_done(p2); | racct_proc_fork_done(p2); | |||||||||
| if ((fr->fr_flags & RFSTOPPED) == 0) { | if ((fr->fr_flags & RFSTOPPED) == 0) { | |||||||||
| if (fr->fr_pidp != NULL) | if (fr->fr_pidp != NULL) | |||||||||
| *fr->fr_pidp = p2->p_pid; | *fr->fr_pidp = p2->p_pid; | |||||||||
| /* | /* | |||||||||
| * If RFSTOPPED not requested, make child runnable and | * If RFSTOPPED not requested, make child runnable and | |||||||||
| * add to run queue. | * add to run queue. | |||||||||
| ▲ Show 20 Lines • Show All 443 Lines • Show Last 20 Lines | ||||||||||