Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_fork.c
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2, | ||||
bzero(&td2->td_startzero, | bzero(&td2->td_startzero, | ||||
__rangeof(struct thread, td_startzero, td_endzero)); | __rangeof(struct thread, td_startzero, td_endzero)); | ||||
bcopy(&td->td_startcopy, &td2->td_startcopy, | bcopy(&td->td_startcopy, &td2->td_startcopy, | ||||
__rangeof(struct thread, td_startcopy, td_endcopy)); | __rangeof(struct thread, td_startcopy, td_endcopy)); | ||||
bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); | bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); | ||||
td2->td_pax = p2->p_pax; | |||||
td2->td_sigstk = td->td_sigstk; | td2->td_sigstk = td->td_sigstk; | ||||
td2->td_flags = TDF_INMEM; | td2->td_flags = TDF_INMEM; | ||||
td2->td_lend_user_pri = PRI_MAX; | td2->td_lend_user_pri = PRI_MAX; | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
td2->td_vnet = NULL; | td2->td_vnet = NULL; | ||||
td2->td_vnet_lpush = NULL; | td2->td_vnet_lpush = NULL; | ||||
#endif | #endif | ||||
Show All 37 Lines | #endif | ||||
if (p1->p_flag2 & P2_INHERIT_PROTECTED) { | if (p1->p_flag2 & P2_INHERIT_PROTECTED) { | ||||
p2->p_flag |= P_PROTECTED; | p2->p_flag |= P_PROTECTED; | ||||
p2->p_flag2 |= P2_INHERIT_PROTECTED; | p2->p_flag2 |= P2_INHERIT_PROTECTED; | ||||
} | } | ||||
/* | /* | ||||
* p_limit is copy-on-write. Bump its refcount. | * p_limit is copy-on-write. Bump its refcount. | ||||
*/ | */ | ||||
lim_fork(p1, p2); | lim_fork(p1, p2); | ||||
rwatson: Shouldn't this simply be between p_startcopy and p_endcopy so that it is automatically… | |||||
Not Done Inline ActionsYes, in progress. op: Yes, in progress. | |||||
pstats_fork(p1->p_stats, p2->p_stats); | pstats_fork(p1->p_stats, p2->p_stats); | ||||
PROC_UNLOCK(p1); | PROC_UNLOCK(p1); | ||||
PROC_UNLOCK(p2); | PROC_UNLOCK(p2); | ||||
/* Bump references to the text vnode (for procfs). */ | /* Bump references to the text vnode (for procfs). */ | ||||
if (p2->p_textvp) | if (p2->p_textvp) | ||||
▲ Show 20 Lines • Show All 522 Lines • Show Last 20 Lines |
Shouldn't this simply be between p_startcopy and p_endcopy so that it is automatically propagated?