|
@@ -269,12 +269,13 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
|
|
application calling fork. */
|
|
application calling fork. */
|
|
if (clone_flags & CLONE_SETTLS)
|
|
if (clone_flags & CLONE_SETTLS)
|
|
childti->pcb.unique = regs->r20;
|
|
childti->pcb.unique = regs->r20;
|
|
|
|
+ else
|
|
|
|
+ regs->r20 = 0; /* OSF/1 has some strange fork() semantics. */
|
|
childti->pcb.usp = usp ?: rdusp();
|
|
childti->pcb.usp = usp ?: rdusp();
|
|
*childregs = *regs;
|
|
*childregs = *regs;
|
|
childregs->r0 = 0;
|
|
childregs->r0 = 0;
|
|
childregs->r19 = 0;
|
|
childregs->r19 = 0;
|
|
childregs->r20 = 1; /* OSF/1 has some strange fork() semantics. */
|
|
childregs->r20 = 1; /* OSF/1 has some strange fork() semantics. */
|
|
- regs->r20 = 0;
|
|
|
|
stack = ((struct switch_stack *) regs) - 1;
|
|
stack = ((struct switch_stack *) regs) - 1;
|
|
*childstack = *stack;
|
|
*childstack = *stack;
|
|
childstack->r26 = (unsigned long) ret_from_fork;
|
|
childstack->r26 = (unsigned long) ret_from_fork;
|