summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormw <mw@NetBSD.org>1993-10-31 01:53:36 +0000
committermw <mw@NetBSD.org>1993-10-31 01:53:36 +0000
commit3fb09cab4b4de9a75fee2bb02aa5028bb52fedcc (patch)
treeb2988736dfeacd81a0db5c0f042bab01d19272ee /sys
parentf6ea0d0d1c26f71b36f8fe38c4982692c0640f7c (diff)
Back out of a stack-adjust (in COMPAT_SUNOS mode) after syscalls that
returned ERESTART.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amiga/amiga/trap.c15
1 files changed, 14 insertions, 1 deletions
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;