From 94b52c57309c754aa1dabc9914ed7bd92a3bdb92 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 23 Apr 2019 17:10:35 -0700 Subject: [PATCH] Forward return value of syscall. --- kern/trap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kern/trap.c b/kern/trap.c index 8ed3fa8..88ca879 100644 --- a/kern/trap.c +++ b/kern/trap.c @@ -203,12 +203,13 @@ trap_dispatch(struct Trapframe *tf) monitor(tf); return; } else if (tf->tf_trapno == T_SYSCALL) { - syscall(tf->tf_regs.reg_eax, + int32_t returned = syscall(tf->tf_regs.reg_eax, tf->tf_regs.reg_edx, tf->tf_regs.reg_ecx, tf->tf_regs.reg_ebx, tf->tf_regs.reg_edi, tf->tf_regs.reg_esi); + tf->tf_regs.reg_eax = returned; return; }