From 3fb09cab4b4de9a75fee2bb02aa5028bb52fedcc Mon Sep 17 00:00:00 2001 From: mw Date: Sun, 31 Oct 1993 01:53:36 +0000 Subject: Back out of a stack-adjust (in COMPAT_SUNOS mode) after syscalls that returned ERESTART. --- sys/arch/amiga/amiga/trap.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/arch/amiga/amiga/trap.c b/sys/arch/amiga/amiga/trap.c index 816ab568acf..fb95ac9f56c 100644 --- a/sys/arch/amiga/amiga/trap.c +++ b/sys/arch/amiga/amiga/trap.c @@ -540,7 +540,12 @@ syscall(code, frame) XXX stored pc on the stack to skip, the argument follows XXX the syscall number without a gap. */ if (code != SYS_sun_sigreturn) - frame.f_regs[SP] += sizeof (int); + { + frame.f_regs[SP] += sizeof (int); + /* remember that we adjusted the SP, might have to undo + this if the system call returns ERESTART. */ + p->p_md.md_flags |= MDP_STACKADJ; + } break; #endif @@ -617,6 +622,14 @@ done: * if this is a child returning from fork syscall. */ p = curproc; +#ifdef COMPAT_SUNOS + /* need new p-value for this */ + if (error == ERESTART && (p->p_md.md_flags & MDP_STACKADJ)) + { + frame.f_regs[SP] -= sizeof (int); + p->p_md.md_flags &= ~MDP_STACKADJ; + } +#endif while (i = CURSIG(p)) psig(i); p->p_pri = p->p_usrpri; -- cgit