vserver 1.9.3
[linux-2.6.git] / arch / x86_64 / ia32 / sys_ia32.c
index 8b47342..267a4a8 100644 (file)
@@ -61,7 +61,6 @@
 #include <linux/ptrace.h>
 #include <linux/highuid.h>
 #include <linux/vmalloc.h>
-#include <linux/vs_cvirt.h>
 #include <asm/mman.h>
 #include <asm/types.h>
 #include <asm/uaccess.h>
@@ -1128,7 +1127,7 @@ long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
 } 
 
 asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
-                            compat_uptr_t __user *envp, struct pt_regs regs)
+                            compat_uptr_t __user *envp, struct pt_regs *regs)
 {
        long error;
        char * filename;
@@ -1137,21 +1136,47 @@ asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
        error = PTR_ERR(filename);
        if (IS_ERR(filename))
                return error;
-       error = compat_do_execve(filename, argv, envp, &regs);
+       error = compat_do_execve(filename, argv, envp, regs);
        if (error == 0)
                current->ptrace &= ~PT_DTRACE;
        putname(filename);
        return error;
 }
 
-asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp, struct pt_regs regs)
+asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
+                           struct pt_regs *regs)
 {
-       void __user *parent_tid = (void __user *)regs.rdx;
-       void __user *child_tid = (void __user *)regs.rdi; 
+       void __user *parent_tid = (void __user *)regs->rdx;
+       void __user *child_tid = (void __user *)regs->rdi;
        if (!newsp)
-               newsp = regs.rsp;
-        return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0, 
-                   parent_tid, child_tid);
+               newsp = regs->rsp;
+        return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
+}
+
+asmlinkage long sys32_waitid(int which, compat_pid_t pid,
+                            siginfo_t32 __user *uinfo, int options,
+                            struct compat_rusage __user *uru)
+{
+       siginfo_t info;
+       struct rusage ru;
+       long ret;
+       mm_segment_t old_fs = get_fs();
+
+       info.si_signo = 0;
+       set_fs (KERNEL_DS);
+       ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
+                        uru ? &ru : NULL);
+       set_fs (old_fs);
+
+       if (ret < 0 || info.si_signo == 0)
+               return ret;
+
+       if (uru && (ret = put_compat_rusage(&ru, uru)))
+               return ret;
+
+       BUG_ON(info.si_code & __SI_MASK);
+       info.si_code |= __SI_CHLD;
+       return ia32_copy_siginfo_to_user(uinfo, &info);
 }
 
 /*
@@ -1265,7 +1290,7 @@ asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
                if (fd >= 0) {
                        struct file *f = filp_open(tmp, flags, mode);
                        error = PTR_ERR(f);
-                       if (unlikely(IS_ERR(f))) {
+                       if (IS_ERR(f)) {
                                put_unused_fd(fd); 
                                fd = error;
                        } else
@@ -1340,6 +1365,12 @@ long sys32_quotactl(void)
        return -ENOSYS;
 } 
 
+long sys32_lookup_dcookie(u32 addr_low, u32 addr_high,
+                         char __user * buf, size_t len)
+{
+       return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len);
+}
+
 cond_syscall(sys32_ipc)
 
 static int __init ia32_init (void)