kern_fork.c (be67169a57e10d3a2e09786b0268736737248f7d) | kern_fork.c (74b2192ae6309fcbe617ed63389125ff0c152af2) |
---|---|
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.48 1997/11/06 19:29:09 phk Exp $ | 39 * $Id: kern_fork.c,v 1.49 1997/11/20 16:36:17 bde 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> --- 15 unchanged lines hidden (view full) --- 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 | 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> --- 15 unchanged lines hidden (view full) --- 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 |
71static int fork1 __P((struct proc *p, int flags)); 72 | |
73/* 74 * These are the stuctures used to create a callout list for things to do 75 * when forking a process 76 */ 77typedef struct fork_list_element { 78 struct fork_list_element *next; 79 forklist_fn function; 80} *fle_p; --- 35 unchanged lines hidden (view full) --- 116 117 return (fork1(p, uap->flags)); 118} 119 120 121int nprocs = 1; /* process 0 */ 122static int nextpid = 0; 123 | 71/* 72 * These are the stuctures used to create a callout list for things to do 73 * when forking a process 74 */ 75typedef struct fork_list_element { 76 struct fork_list_element *next; 77 forklist_fn function; 78} *fle_p; --- 35 unchanged lines hidden (view full) --- 114 115 return (fork1(p, uap->flags)); 116} 117 118 119int nprocs = 1; /* process 0 */ 120static int nextpid = 0; 121 |
124static int | 122int |
125fork1(p1, flags) 126 register struct proc *p1; 127 int flags; 128{ 129 register struct proc *p2, *pptr; 130 register uid_t uid; 131 struct proc *newproc; 132 int count; --- 369 unchanged lines hidden --- | 123fork1(p1, flags) 124 register struct proc *p1; 125 int flags; 126{ 127 register struct proc *p2, *pptr; 128 register uid_t uid; 129 struct proc *newproc; 130 int count; --- 369 unchanged lines hidden --- |