]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/kernel/sys_oabi-compat.c
Merge branches 'pxa-ian' and 'pxa-xm270' into pxa
[linux-2.6-omap-h63xx.git] / arch / arm / kernel / sys_oabi-compat.c
index 9d4b76409c6446a99173a160d6e4a4349a015dd3..96ab5f52949c99d145aea4be30f077e5ea34ef9f 100644 (file)
@@ -25,6 +25,7 @@
  * sys_stat64:
  * sys_lstat64:
  * sys_fstat64:
+ * sys_fstatat64:
  *
  *   struct stat64 has different sizes and some members are shifted
  *   Compatibility wrappers are needed for them and provided below.
@@ -64,6 +65,7 @@
  * sys_connect:
  * sys_sendmsg:
  * sys_sendto:
+ * sys_socketcall:
  *
  *   struct sockaddr_un loses its padding with EABI.  Since the size of the
  *   structure is used as a validation test in unix_mkname(), we need to
@@ -78,7 +80,8 @@
 #include <linux/eventpoll.h>
 #include <linux/sem.h>
 #include <linux/socket.h>
-#include <asm/ipc.h>
+#include <linux/net.h>
+#include <linux/ipc.h>
 #include <asm/uaccess.h>
 
 struct oldabi_stat64 {
@@ -167,6 +170,29 @@ asmlinkage long sys_oabi_fstat64(unsigned long fd,
        return error;
 }
 
+asmlinkage long sys_oabi_fstatat64(int dfd,
+                                  char __user *filename,
+                                  struct oldabi_stat64  __user *statbuf,
+                                  int flag)
+{
+       struct kstat stat;
+       int error = -EINVAL;
+
+       if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
+               goto out;
+
+       if (flag & AT_SYMLINK_NOFOLLOW)
+               error = vfs_lstat_fd(dfd, filename, &stat);
+       else
+               error = vfs_stat_fd(dfd, filename, &stat);
+
+       if (!error)
+       error = cp_oldabi_stat64(&stat, statbuf);
+
+out:
+       return error;
+}
+
 struct oabi_flock64 {
        short   l_type;
        short   l_whence;
@@ -408,3 +434,31 @@ asmlinkage long sys_oabi_sendmsg(int fd, struct msghdr __user *msg, unsigned fla
        return sys_sendmsg(fd, msg, flags);
 }
 
+asmlinkage long sys_oabi_socketcall(int call, unsigned long __user *args)
+{
+       unsigned long r = -EFAULT, a[6];
+
+       switch (call) {
+       case SYS_BIND:
+               if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
+                       r = sys_oabi_bind(a[0], (struct sockaddr __user *)a[1], a[2]);
+               break;
+       case SYS_CONNECT:
+               if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
+                       r = sys_oabi_connect(a[0], (struct sockaddr __user *)a[1], a[2]);
+               break;
+       case SYS_SENDTO:
+               if (copy_from_user(a, args, 6 * sizeof(long)) == 0)
+                       r = sys_oabi_sendto(a[0], (void __user *)a[1], a[2], a[3],
+                                           (struct sockaddr __user *)a[4], a[5]);
+               break;
+       case SYS_SENDMSG:
+               if (copy_from_user(a, args, 3 * sizeof(long)) == 0)
+                       r = sys_oabi_sendmsg(a[0], (struct msghdr __user *)a[1], a[2]);
+               break;
+       default:
+               r = sys_socketcall(call, args);
+       }
+
+       return r;
+}