=================================================================== Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- um-linux-2.4.27-paolo/arch/um/kernel/skas/process.c | 36 ++++++++++---------- 1 files changed, 19 insertions(+), 17 deletions(-) diff -puN arch/um/kernel/skas/process.c~fix-sysemu arch/um/kernel/skas/process.c --- um-linux-2.4.27/arch/um/kernel/skas/process.c~fix-sysemu 2005-04-15 11:13:07.000000000 +0200 +++ um-linux-2.4.27-paolo/arch/um/kernel/skas/process.c 2005-04-15 11:13:07.000000000 +0200 @@ -67,25 +67,27 @@ static void handle_trap(int pid, union u return; } - handle_syscall(regs); - if(use_sysemu) - return; + if(!use_sysemu){ + err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, + __NR_getpid); + if(err < 0) + panic("handle_trap - nullifying syscall failed, " + "errno = %d\n", errno); - err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, __NR_getpid); - if(err < 0) - panic("handle_trap - nullifying syscall failed, errno = %d\n", - errno); + err = ptrace(PTRACE_SYSCALL, pid, 0, 0); + if(err < 0) + panic("handle_trap - continuing to end of syscall " + "failed, errno = %d\n", errno); - err = ptrace(PTRACE_SYSCALL, pid, 0, 0); - if(err < 0) - panic("handle_trap - continuing to end of syscall failed, " - "errno = %d\n", errno); - - CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); - if((err < 0) || !WIFSTOPPED(status) || - (WSTOPSIG(status) != SIGTRAP)) - panic("handle_trap - failed to wait at end of syscall, " - "errno = %d, status = %d\n", errno, status); + CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED)); + if((err < 0) || !WIFSTOPPED(status) || + (WSTOPSIG(status) != SIGTRAP)) + panic("handle_trap - failed to wait at end of " + "syscall, errno = %d, status = %d\n", errno, + status); + } + + handle_syscall(regs); } static int userspace_tramp(void *arg) _