summaryrefslogtreecommitdiffstats
path: root/sys/alpha/linux/linux_machdep.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-11 23:41:55 +0000
committerjhb <jhb@FreeBSD.org>2001-03-11 23:41:55 +0000
commitb3ef374c7634ed1a5b3748c2c966435d6c219284 (patch)
treeadd69fe35fd9b716f6eacc1677cd77f451158a44 /sys/alpha/linux/linux_machdep.c
parent096f4f13956689d2c77cb2938fde7b9ab7e8b81e (diff)
downloadFreeBSD-src-b3ef374c7634ed1a5b3748c2c966435d6c219284.zip
FreeBSD-src-b3ef374c7634ed1a5b3748c2c966435d6c219284.tar.gz
- Call fork1() directly instead of calling rfork() so that it doesn't mask
out RFSTOPPED. - Lock the child process when settings p_sigparent instead of locking the parent. Pointy-hat to: me
Diffstat (limited to 'sys/alpha/linux/linux_machdep.c')
-rw-r--r--sys/alpha/linux/linux_machdep.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/alpha/linux/linux_machdep.c b/sys/alpha/linux/linux_machdep.c
index 58905c9..98b3918 100644
--- a/sys/alpha/linux/linux_machdep.c
+++ b/sys/alpha/linux/linux_machdep.c
@@ -122,7 +122,6 @@ linux_clone(struct proc *p, struct linux_clone_args *args)
struct proc *p2;
int exit_signal;
vm_offset_t start;
- struct rfork_args rf_args;
#ifdef DEBUG
if (ldebug(clone)) {
@@ -156,17 +155,12 @@ linux_clone(struct proc *p, struct linux_clone_args *args)
error = 0;
start = 0;
- rf_args.flags = ff;
- if ((error = rfork(p, &rf_args)) != 0)
+ if ((error = fork1(p, ff, &p2)) != 0)
return (error);
- p2 = pfind(p->p_retval[0]);
- if (p2 == NULL)
- return (ESRCH);
-
- PROC_LOCK(p);
+ PROC_LOCK(p2);
p2->p_sigparent = exit_signal;
- PROC_UNLOCK(p);
+ PROC_UNLOCK(p2);
p2->p_addr->u_pcb.pcb_hw.apcb_usp = (unsigned long)args->stack;
#ifdef DEBUG
@@ -183,6 +177,8 @@ linux_clone(struct proc *p, struct linux_clone_args *args)
setrunqueue(p2);
mtx_unlock_spin(&sched_lock);
+ p->p_retval[0] = p2->p_pid;
+ p->p_retval[1] = 0;
return (0);
}
OpenPOWER on IntegriCloud