Patchwork [2/6] mips: missing syscall returns wrong errno

login
register
mail settings
Submitter Wesley W. Terpstra
Date July 8, 2011, 12:58 p.m.
Message ID <CAA-O0Xgf-_FdEkmS9xASkyUvXgMvWdMEDtrvWPu1OMrfcY_Vag@mail.gmail.com>
Download mbox | patch
Permalink /patch/103842/
State New
Headers show

Comments

Wesley W. Terpstra - July 8, 2011, 12:58 p.m.
Return -TARGET_ENOSYS instead of -ENOSYS from linux-user/main.c
   * Caused strange 'Level 2 synchronization messages' instead of
correctly reporting the syscall was missing.
   * Made glibc simply fail instead of using older syscalls

Signed-off-by: Wesley W. Terpstra <terpstra@debian.org>
---

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 289054b..26ebc73 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2053,7 +2067,7 @@  void cpu_loop(CPUMIPSState *env)
             syscall_num = env->active_tc.gpr[2] - 4000;
             env->active_tc.PC += 4;
             if (syscall_num >= sizeof(mips_syscall_args)) {
-                ret = -ENOSYS;
+                ret = -TARGET_ENOSYS;
             } else {
                 int nb_args;
                 abi_ulong sp_reg;