]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/m68knommu/kernel/sys_m68k.c
container freezer: implement freezer cgroup subsystem
[linux-2.6-omap-h63xx.git] / arch / m68knommu / kernel / sys_m68k.c
index c3494b8447d155f890a319097b97fdf352eb4319..70028163862981e5ce0f7082a737b97f73f88163 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/shm.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/utsname.h>
+#include <linux/ipc.h>
+#include <linux/fs.h>
 
 #include <asm/setup.h>
 #include <asm/uaccess.h>
 #include <asm/cachectl.h>
 #include <asm/traps.h>
-#include <asm/ipc.h>
 #include <asm/cacheflush.h>
 #include <asm/unistd.h>
 
-/*
- * sys_pipe() is the normal C calling standard for creating
- * a pipe. It's not the way unix traditionally does this, though.
- */
-asmlinkage int sys_pipe(unsigned long * fildes)
-{
-       int fd[2];
-       int error;
-
-       error = do_pipe(fd);
-       if (!error) {
-               if (copy_to_user(fildes, fd, 2*sizeof(int)))
-                       error = -EFAULT;
-       }
-       return error;
-}
-
 /* common code for old and new mmaps */
 static inline long do_mmap2(
        unsigned long addr, unsigned long len,
@@ -137,7 +120,7 @@ asmlinkage int old_select(struct sel_arg_struct *arg)
 asmlinkage int sys_ipc (uint call, int first, int second,
                        int third, void *ptr, long fifth)
 {
-       int version;
+       int version, ret;
 
        version = call >> 16; /* hack for backward compatibility */
        call &= 0xffff;
@@ -190,6 +173,27 @@ asmlinkage int sys_ipc (uint call, int first, int second,
                default:
                        return -EINVAL;
                }
+       if (call <= SHMCTL)
+               switch (call) {
+               case SHMAT:
+                       switch (version) {
+                       default: {
+                               ulong raddr;
+                               ret = do_shmat (first, ptr, second, &raddr);
+                               if (ret)
+                                       return ret;
+                               return put_user (raddr, (ulong __user *) third);
+                       }
+                       }
+               case SHMDT:
+                       return sys_shmdt (ptr);
+               case SHMGET:
+                       return sys_shmget (first, second, third);
+               case SHMCTL:
+                       return sys_shmctl (first, second, ptr);
+               default:
+                       return -ENOSYS;
+               }
 
        return -EINVAL;
 }