kern_fork.c (42379) | kern_fork.c (43208) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 |
39 * $Id: kern_fork.c,v 1.53 1998/12/19 02:55:33 julian Exp $ | 39 * $Id: kern_fork.c,v 1.54 1999/01/07 21:23:42 julian Exp $ |
40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/sysproto.h> 47#include <sys/filedesc.h> --- 9 unchanged lines hidden (view full) --- 57 58#include <vm/vm.h> 59#include <sys/lock.h> 60#include <vm/pmap.h> 61#include <vm/vm_map.h> 62#include <vm/vm_extern.h> 63#include <vm/vm_zone.h> 64 | 40 */ 41 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/sysproto.h> 47#include <sys/filedesc.h> --- 9 unchanged lines hidden (view full) --- 57 58#include <vm/vm.h> 59#include <sys/lock.h> 60#include <vm/pmap.h> 61#include <vm/vm_map.h> 62#include <vm/vm_extern.h> 63#include <vm/vm_zone.h> 64 |
65#ifdef COMPAT_LINUX_THREADS | |
66#include <machine/frame.h> 67#include <sys/user.h> | 65#include <machine/frame.h> 66#include <sys/user.h> |
68#endif /* COMPAT_LINUX_THREADS */ | 67 |
69#ifdef SMP 70static int fast_vfork = 0; /* Doesn't work on SMP yet. */ 71#else 72static int fast_vfork = 1; 73#endif 74SYSCTL_INT(_kern, OID_AUTO, fast_vfork, CTLFLAG_RW, &fast_vfork, 0, ""); 75 76/* --- 247 unchanged lines hidden (view full) --- 324 if (p1->p_flag & P_PROFIL) 325 startprofclock(p2); 326 MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred), 327 M_SUBPROC, M_WAITOK); 328 bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred)); 329 p2->p_cred->p_refcnt = 1; 330 crhold(p1->p_ucred); 331 | 68#ifdef SMP 69static int fast_vfork = 0; /* Doesn't work on SMP yet. */ 70#else 71static int fast_vfork = 1; 72#endif 73SYSCTL_INT(_kern, OID_AUTO, fast_vfork, CTLFLAG_RW, &fast_vfork, 0, ""); 74 75/* --- 247 unchanged lines hidden (view full) --- 323 if (p1->p_flag & P_PROFIL) 324 startprofclock(p2); 325 MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred), 326 M_SUBPROC, M_WAITOK); 327 bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred)); 328 p2->p_cred->p_refcnt = 1; 329 crhold(p1->p_ucred); 330 |
332#ifdef COMPAT_LINUX_THREADS | |
333 if (flags & RFSIGSHARE) { 334 p2->p_procsig = p1->p_procsig; 335 p2->p_procsig->ps_refcnt++; 336 if (p1->p_sigacts == &p1->p_addr->u_sigacts) { 337 struct sigacts *newsigacts; 338 int s; 339 340 if (p2->p_procsig->ps_refcnt != 2) --- 20 unchanged lines hidden (view full) --- 361 (unsigned)&p1->p_procsig->ps_begincopy); 362 p2->p_procsig->ps_refcnt = 1; 363 /* Note that we fill in the values of sigacts in vm_fork */ 364 p2->p_sigacts = NULL; 365 } 366 if (flags & RFLINUXTHPN) { 367 p2->p_sigparent = SIGUSR1; 368 } | 331 if (flags & RFSIGSHARE) { 332 p2->p_procsig = p1->p_procsig; 333 p2->p_procsig->ps_refcnt++; 334 if (p1->p_sigacts == &p1->p_addr->u_sigacts) { 335 struct sigacts *newsigacts; 336 int s; 337 338 if (p2->p_procsig->ps_refcnt != 2) --- 20 unchanged lines hidden (view full) --- 359 (unsigned)&p1->p_procsig->ps_begincopy); 360 p2->p_procsig->ps_refcnt = 1; 361 /* Note that we fill in the values of sigacts in vm_fork */ 362 p2->p_sigacts = NULL; 363 } 364 if (flags & RFLINUXTHPN) { 365 p2->p_sigparent = SIGUSR1; 366 } |
369#endif /* COMPAT_LINUX_THREADS */ | 367 |
370 /* bump references to the text vnode (for procfs) */ 371 p2->p_textvp = p1->p_textvp; 372 if (p2->p_textvp) 373 VREF(p2->p_textvp); 374 375 if (flags & RFCFDG) 376 p2->p_fd = fdinit(p1); 377 else if (flags & RFFDG) --- 169 unchanged lines hidden --- | 368 /* bump references to the text vnode (for procfs) */ 369 p2->p_textvp = p1->p_textvp; 370 if (p2->p_textvp) 371 VREF(p2->p_textvp); 372 373 if (flags & RFCFDG) 374 p2->p_fd = fdinit(p1); 375 else if (flags & RFFDG) --- 169 unchanged lines hidden --- |