The qemu errno is negative of normal errno, so revert it before return from syscall, or the related user mode checking will fail, e.g. cp/mv will call stat64 and check errno ENOENT (not -ENOENT).
Signed-of-by Chen Gang <gang.chen.5...@gmail.com> --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index 253aade..f0bda09 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3654,7 +3654,7 @@ void cpu_loop(CPUTLGState *env) env->regs[4], env->regs[5], env->regs[6], env->regs[7]); env->regs[TILEGX_R_ERR] = TILEGX_IS_ERRNO(env->regs[TILEGX_R_RE]) - ? env->regs[TILEGX_R_RE] + ? - env->regs[TILEGX_R_RE] : 0; break; case TILEGX_EXCP_OPCODE_EXCH: -- 1.9.3