From: Jeff Dike <jdike@addtoit.com>

From: Bodo Stroesser - Change is_syscall to check for sysenter and also that
we are actually executing a system call.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/um/sys-i386/ptrace.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN arch/um/sys-i386/ptrace.c~uml-sysenter-is-syscall arch/um/sys-i386/ptrace.c
--- 25/arch/um/sys-i386/ptrace.c~uml-sysenter-is-syscall	2004-11-04 20:37:12.990522096 -0800
+++ 25-akpm/arch/um/sys-i386/ptrace.c	2004-11-04 20:37:12.993521640 -0800
@@ -7,6 +7,7 @@
 #include "asm/elf.h"
 #include "asm/ptrace.h"
 #include "asm/uaccess.h"
+#include "asm/unistd.h"
 #include "ptrace_user.h"
 #include "sysdep/sigcontext.h"
 #include "sysdep/sc.h"
@@ -23,11 +24,12 @@ int is_syscall(unsigned long addr)
 
 	n = copy_from_user(&instr, (void *) addr, sizeof(instr));
 	if(n){
-		printk("is_syscall : failed to read instruction from 0x%lu\n", 
+		printk("is_syscall : failed to read instruction from 0x%lx\n",
 		       addr);
 		return(0);
 	}
-	return(instr == 0x80cd);
+	return( (instr == 0x80cd || instr == 0x340f) &&
+	        PT_REGS_EAX(&current->thread.regs) < NR_syscalls);
 }
 
 /* determines which flags the user has access to. */
_