PERFORCE change 99220 for review
Roman Divacky
rdivacky at FreeBSD.org
Wed Jun 14 12:56:27 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99220
Change 99220 by rdivacky at rdivacky_witten on 2006/06/14 12:53:58
First attempt to make linux programs work under 2.6. There's still the setpgid/setpgrp
problem but I am working on it. Now we can run most of the programs but some coredumps.
Affected files ...
.. //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_machdep.c#2 edit
.. //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#2 edit
Differences ...
==== //depot/projects/soc2006/rdivacky_linuxolator/amd64/linux32/linux32_machdep.c#2 (text+ko) ====
@@ -496,9 +496,6 @@
}
#endif
- if (!args->stack)
- return (EINVAL);
-
exit_signal = args->flags & 0x000000ff;
if (exit_signal >= LINUX_NSIG)
return (EINVAL);
@@ -522,7 +519,11 @@
p2->p_sigparent = exit_signal;
PROC_UNLOCK(p2);
td2 = FIRST_THREAD_IN_PROC(p2);
- td2->td_frame->tf_rsp = PTROUT(args->stack);
+ /* XXX: in a case of stack = NULL we are supposed to COW calling process stack
+ * this is what normal fork() does so we just keep the tf_esp arg intact
+ */
+ if (args->stack)
+ td2->td_frame->tf_rsp = PTROUT(args->stack);
#ifdef DEBUG
if (ldebug(clone))
==== //depot/projects/soc2006/rdivacky_linuxolator/i386/linux/linux_machdep.c#2 (text+ko) ====
@@ -334,9 +334,6 @@
}
#endif
- if (!args->stack)
- return (EINVAL);
-
exit_signal = args->flags & 0x000000ff;
if (exit_signal >= LINUX_NSIG)
return (EINVAL);
@@ -376,7 +373,11 @@
p2->p_sigparent = exit_signal;
PROC_UNLOCK(p2);
td2 = FIRST_THREAD_IN_PROC(p2);
- td2->td_frame->tf_esp = (unsigned int)args->stack;
+ /* XXX: in a case of stack = NULL we are supposed to COW calling process stack
+ * this is what normal fork() does so we just keep the tf_esp arg intact
+ */
+ if (args->stack)
+ td2->td_frame->tf_esp = (unsigned int)args->stack;
#ifdef DEBUG
if (ldebug(clone))
More information about the p4-projects
mailing list