This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / um / kernel / tt / syscall_user.c
index b06217d..1cabbd8 100644 (file)
 #include "syscall_user.h"
 #include "tt.h"
 
+/* XXX Bogus */
+#define ERESTARTSYS    512
+#define ERESTARTNOINTR 513
+#define ERESTARTNOHAND 514
 
 void syscall_handler_tt(int sig, union uml_pt_regs *regs)
 {
@@ -29,7 +33,7 @@ void syscall_handler_tt(int sig, union uml_pt_regs *regs)
        SC_START_SYSCALL(sc);
 
        index = record_syscall_start(syscall);
-       syscall_trace(regs, 0);
+       syscall_trace(regs, 1);
        result = execute_syscall(regs);
 
        /* regs->sc may have changed while the system call ran (there may
@@ -38,12 +42,15 @@ void syscall_handler_tt(int sig, union uml_pt_regs *regs)
        UPT_SC(regs) = sc;
 
        SC_SET_SYSCALL_RETURN(sc, result);
+       if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || 
+          (result == -ERESTARTNOINTR))
+               do_signal(result);
 
-       syscall_trace(regs, 1);
+       syscall_trace(regs, 0);
        record_syscall_end(index, result);
 }
 
-int do_syscall(void *task, int pid, int local_using_sysemu)
+int do_syscall(void *task, int pid)
 {
        unsigned long proc_regs[FRAME_SIZE];
        union uml_pt_regs *regs;
@@ -56,17 +63,13 @@ int do_syscall(void *task, int pid, int local_using_sysemu)
        regs = TASK_REGS(task);
        UPT_SYSCALL_NR(regs) = syscall;
 
-       if(syscall < 0)
-               return(0);
+       if(syscall < 1) return(0);
 
        if((syscall != __NR_sigreturn) &&
           ((unsigned long *) PT_IP(proc_regs) >= &_stext) && 
           ((unsigned long *) PT_IP(proc_regs) <= &_etext))
                tracer_panic("I'm tracing myself and I can't get out");
 
-       if(local_using_sysemu)
-               return(1);
-
        if(ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET, 
                  __NR_getpid) < 0)
                tracer_panic("do_syscall : Nullifying syscall failed, "