Deleted Added
full compact
kern_fork.c (41038) kern_fork.c (41931)
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.51 1998/01/22 17:29:46 dyson Exp $
39 * $Id: kern_fork.c,v 1.52 1998/11/09 15:07:41 truckman 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
68#endif /* COMPAT_LINUX_THREADS */
65#ifdef SMP
66static int fast_vfork = 0; /* Doesn't work on SMP yet. */
67#else
68static int fast_vfork = 1;
69#endif
70SYSCTL_INT(_kern, OID_AUTO, fast_vfork, CTLFLAG_RW, &fast_vfork, 0, "");
71
72/*

--- 247 unchanged lines hidden (view full) ---

320 if (p1->p_flag & P_PROFIL)
321 startprofclock(p2);
322 MALLOC(p2->p_cred, struct pcred *, sizeof(struct pcred),
323 M_SUBPROC, M_WAITOK);
324 bcopy(p1->p_cred, p2->p_cred, sizeof(*p2->p_cred));
325 p2->p_cred->p_refcnt = 1;
326 crhold(p1->p_ucred);
327
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
332#ifdef COMPAT_LINUX_THREADS
333 if (flags & RFSIGSHARE) {
334 p2->p_procsig->ps_refcnt++;
335 } else {
336 p2->p_procsig = malloc(sizeof(struct procsig), M_TEMP, M_WAITOK);
337 p2->p_procsig->ps_refcnt = 1;
338 p2->p_procsig->ps_posix = 0;
339 bcopy(&p1->p_procsig->ps_begincopy, &p2->p_procsig->ps_begincopy,
340 (unsigned)&p1->p_procsig->ps_endcopy -
341 (unsigned)&p1->p_procsig->ps_begincopy);
342 }
343 if (flags & RFLINUXTHPN) {
344 p2->p_sigparent = SIGUSR1;
345 }
346 p2->p_sigacts = &p2->p_procsig->ps_sigacts;
347 if((flags & RFTHREAD) != 0 && (flags & RFPOSIXSIG) != 0)
348 p2->p_procsig->ps_posix = 1;
349#endif /* COMPAT_LINUX_THREADS */
328 /* bump references to the text vnode (for procfs) */
329 p2->p_textvp = p1->p_textvp;
330 if (p2->p_textvp)
331 VREF(p2->p_textvp);
332
333 if (flags & RFCFDG)
334 p2->p_fd = fdinit(p1);
335 else if (flags & RFFDG)

--- 169 unchanged lines hidden ---
350 /* bump references to the text vnode (for procfs) */
351 p2->p_textvp = p1->p_textvp;
352 if (p2->p_textvp)
353 VREF(p2->p_textvp);
354
355 if (flags & RFCFDG)
356 p2->p_fd = fdinit(p1);
357 else if (flags & RFFDG)

--- 169 unchanged lines hidden ---