diff options
-rw-r--r-- | lib/libc/sys/rfork.2 | 3 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 22 | ||||
-rw-r--r-- | sys/sys/proc.h | 3 |
3 files changed, 5 insertions, 23 deletions
diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2 index 43b03e9e231..2c4c337df1e 100644 --- a/lib/libc/sys/rfork.2 +++ b/lib/libc/sys/rfork.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rfork.2,v 1.19 2003/06/18 11:05:21 jmc Exp $ +.\" $OpenBSD: rfork.2,v 1.20 2004/04/02 19:08:58 tedu Exp $ .\" .\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> .\" @@ -80,7 +80,6 @@ The kernel forces sharing of the entire address space. The child will then inherit all the shared segments the parent process owns. Subsequent forks by the parent will then propagate the shared data and bss between children. -The stack segment is always split. .It Dv RFNOWAIT Parent need not .Xr wait 2 diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index f137d22b431..cbcbc568c91 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.63 2003/09/23 20:26:18 millert Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.64 2004/04/02 19:08:58 tedu Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -44,6 +44,7 @@ #include <sys/malloc.h> #include <sys/mount.h> #include <sys/proc.h> +#include <sys/exec.h> #include <sys/resourcevar.h> #include <sys/signalvar.h> #include <sys/vnode.h> @@ -118,7 +119,7 @@ sys_rfork(struct proc *p, void *v, register_t *retval) flags |= FORK_NOZOMBIE; if (rforkflags & RFMEM) - flags |= FORK_VMNOSTACK; + flags |= FORK_SHAREVM; return (fork1(p, SIGCHLD, flags, NULL, 0, NULL, NULL, retval)); } @@ -292,23 +293,6 @@ fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t stacksize, */ PHOLD(p1); - if (flags & FORK_VMNOSTACK) { - /* share everything, but ... */ - uvm_map_inherit(&p1->p_vmspace->vm_map, - VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, - MAP_INHERIT_SHARE); - /* ... don't share stack */ -#ifdef MACHINE_STACK_GROWS_UP - uvm_map_inherit(&p1->p_vmspace->vm_map, - USRSTACK, USRSTACK + MAXSSIZ, - MAP_INHERIT_COPY); -#else - uvm_map_inherit(&p1->p_vmspace->vm_map, - USRSTACK - MAXSSIZ, USRSTACK, - MAP_INHERIT_COPY); -#endif - } - p2->p_addr = (struct user *)uaddr; /* diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 5f3e766c566..592cd9c6e86 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.68 2003/11/08 06:11:11 nordin Exp $ */ +/* $OpenBSD: proc.h,v 1.69 2004/04/02 19:08:58 tedu Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -333,7 +333,6 @@ struct pcred { #define FORK_CLEANFILES 0x00000020 #define FORK_NOZOMBIE 0x00000040 #define FORK_SHAREVM 0x00000080 -#define FORK_VMNOSTACK 0x00000100 #define FORK_SIGHAND 0x00000200 #define PIDHASH(pid) (&pidhashtbl[(pid) & pidhash]) |