kern_fork.c (31675) | kern_fork.c (32702) |
---|---|
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.49 1997/11/20 16:36:17 bde Exp $ | 39 * $Id: kern_fork.c,v 1.50 1997/12/12 04:00:58 dyson 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> --- 7 unchanged lines hidden (view full) --- 55#include <sys/ktrace.h> 56#include <sys/unistd.h> 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> | 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> --- 7 unchanged lines hidden (view full) --- 55#include <sys/ktrace.h> 56#include <sys/unistd.h> 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> |
|
63 64#ifdef SMP 65static int fast_vfork = 0; /* Doesn't work on SMP yet. */ 66#else 67static int fast_vfork = 1; 68#endif 69SYSCTL_INT(_kern, OID_AUTO, fast_vfork, CTLFLAG_RW, &fast_vfork, 0, ""); 70 --- 150 unchanged lines hidden (view full) --- 221 /* 222 * Back out the process count 223 */ 224 nprocs--; 225 return (EAGAIN); 226 } 227 228 /* Allocate new proc. */ | 64 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 --- 150 unchanged lines hidden (view full) --- 222 /* 223 * Back out the process count 224 */ 225 nprocs--; 226 return (EAGAIN); 227 } 228 229 /* Allocate new proc. */ |
229 MALLOC(newproc, struct proc *, sizeof(struct proc), M_PROC, M_WAITOK); | 230 newproc = zalloc(proc_zone); |
230 231/* 232 * Setup linkage for kernel based threading 233 */ 234 if((flags & RFTHREAD) != 0) { 235 newproc->p_peers = p1->p_peers; 236 p1->p_peers = newproc; 237 newproc->p_leader = p1->p_leader; --- 262 unchanged lines hidden --- | 231 232/* 233 * Setup linkage for kernel based threading 234 */ 235 if((flags & RFTHREAD) != 0) { 236 newproc->p_peers = p1->p_peers; 237 p1->p_peers = newproc; 238 newproc->p_leader = p1->p_leader; --- 262 unchanged lines hidden --- |