Also pass fork1() a struct proc **, in case the caller wants a pointer
to the newly created process.
This commit is contained in:
parent
c44d4effcd
commit
ce340c6ca5
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: kern_fork.c,v 1.34 1998/01/04 03:52:02 thorpej Exp $ */
|
/* $NetBSD: kern_fork.c,v 1.35 1998/01/05 05:16:28 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||||
@ -69,7 +69,7 @@ sys_fork(p, v, retval)
|
|||||||
register_t *retval;
|
register_t *retval;
|
||||||
{
|
{
|
||||||
|
|
||||||
return (fork1(p, 0, retval));
|
return (fork1(p, 0, retval, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -84,7 +84,7 @@ sys_vfork(p, v, retval)
|
|||||||
register_t *retval;
|
register_t *retval;
|
||||||
{
|
{
|
||||||
|
|
||||||
return (fork1(p, FORK_PPWAIT, retval));
|
return (fork1(p, FORK_PPWAIT, retval, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -99,14 +99,15 @@ sys___vfork14(p, v, retval)
|
|||||||
register_t *retval;
|
register_t *retval;
|
||||||
{
|
{
|
||||||
|
|
||||||
return (fork1(p, FORK_PPWAIT|FORK_SHAREVM, retval));
|
return (fork1(p, FORK_PPWAIT|FORK_SHAREVM, retval, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
fork1(p1, flags, retval)
|
fork1(p1, flags, retval, rnewprocp)
|
||||||
register struct proc *p1;
|
register struct proc *p1;
|
||||||
int flags;
|
int flags;
|
||||||
register_t *retval;
|
register_t *retval;
|
||||||
|
struct proc **rnewprocp;
|
||||||
{
|
{
|
||||||
register struct proc *p2;
|
register struct proc *p2;
|
||||||
register uid_t uid;
|
register uid_t uid;
|
||||||
@ -295,6 +296,12 @@ again:
|
|||||||
if (flags & FORK_SHAREVM)
|
if (flags & FORK_SHAREVM)
|
||||||
cnt.v_forks_sharevm++;
|
cnt.v_forks_sharevm++;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pass a pointer to the new process to the caller.
|
||||||
|
*/
|
||||||
|
if (rnewprocp != NULL)
|
||||||
|
*rnewprocp = p2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Preserve synchronization semantics of vfork. If waiting for
|
* Preserve synchronization semantics of vfork. If waiting for
|
||||||
* child to exec or exit, set P_PPWAIT on child, and sleep on our
|
* child to exec or exit, set P_PPWAIT on child, and sleep on our
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: proc.h,v 1.54 1998/01/04 03:53:04 thorpej Exp $ */
|
/* $NetBSD: proc.h,v 1.55 1998/01/05 05:16:26 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1986, 1989, 1991, 1993
|
* Copyright (c) 1986, 1989, 1991, 1993
|
||||||
@ -319,7 +319,7 @@ int tsleep __P((void *chan, int pri, const char *wmesg, int timo));
|
|||||||
void unsleep __P((struct proc *));
|
void unsleep __P((struct proc *));
|
||||||
void wakeup __P((void *chan));
|
void wakeup __P((void *chan));
|
||||||
void exit1 __P((struct proc *, int));
|
void exit1 __P((struct proc *, int));
|
||||||
int fork1 __P((struct proc *, int, register_t *));
|
int fork1 __P((struct proc *, int, register_t *, struct proc **));
|
||||||
void kmeminit __P((void));
|
void kmeminit __P((void));
|
||||||
void rqinit __P((void));
|
void rqinit __P((void));
|
||||||
int groupmember __P((gid_t, struct ucred *));
|
int groupmember __P((gid_t, struct ucred *));
|
||||||
|
Loading…
Reference in New Issue
Block a user