vserver 1.9.3
[linux-2.6.git] / arch / um / kernel / ptrace.c
index 90f8d28..0005a9b 100644 (file)
@@ -24,11 +24,6 @@ void ptrace_disable(struct task_struct *child)
 { 
 }
 
-extern long do_mmap2(struct task_struct *task, unsigned long addr, 
-                    unsigned long len, unsigned long prot, 
-                    unsigned long flags, unsigned long fd,
-                    unsigned long pgoff);
-
 int sys_ptrace(long request, long pid, long addr, long data)
 {
        struct task_struct *child;
@@ -294,7 +289,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
        }
 #endif
        default:
-               ret = -EIO;
+               ret = ptrace_request(child, request, addr, data);
                break;
        }
  out_tsk:
@@ -304,8 +299,17 @@ int sys_ptrace(long request, long pid, long addr, long data)
        return ret;
 }
 
-void syscall_trace(void)
+void syscall_trace(union uml_pt_regs *regs, int entryexit)
 {
+       if (unlikely(current->audit_context)) {
+               if (!entryexit)
+                       audit_syscall_entry(current, regs->orig_eax,
+                                           regs->ebx, regs->ecx,
+                                           regs->edx, regs->esi);
+               else
+                       audit_syscall_exit(current, regs->eax);
+       }
+
        if (!test_thread_flag(TIF_SYSCALL_TRACE))
                return;
        if (!(current->ptrace & PT_PTRACED))
@@ -313,11 +317,8 @@ void syscall_trace(void)
 
        /* the 0x80 provides a way for the tracing parent to distinguish
           between a syscall stop and SIGTRAP delivery */
-       current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
-                                       ? 0x80 : 0);
-       current->state = TASK_STOPPED;
-       notify_parent(current, SIGCHLD);
-       schedule();
+       ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
+                                ? 0x80 : 0));
 
        /*
         * this isn't the same as continuing with a signal, but it will do