]> git.hungrycats.org Git - linux/commitdiff
[PATCH] s390: 31 bit compat.
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 27 Jun 2003 02:59:58 +0000 (19:59 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 27 Jun 2003 02:59:58 +0000 (19:59 -0700)
- Add missing includes to compat_ioctl.c.
- Fix 32 bit emulation of sys_settimeofday.

arch/s390/kernel/compat_ioctl.c
arch/s390/kernel/compat_linux.c
include/asm-s390/compat.h

index 01437938cae35064632fb13f363c92cec80d1f5d..04116286f882a22f785b4cd5d90c6efdcd7a76fe 100644 (file)
 #include <linux/random.h>
 #include <linux/raw.h>
 #include <linux/route.h>
+#include <linux/rtc.h>
 #include <linux/vt.h>
 #include <linux/watchdog.h>
 
 #include <linux/auto_fs.h>
+#include <linux/auto_fs4.h>
 #include <linux/devfs_fs.h>
 #include <linux/ext2_fs.h>
+#include <linux/ncp_fs.h>
 #include <linux/smb_fs.h>
 
 #include <linux/if_bonding.h>
index fc131aa5d8ba15115c2425ddb0d8f581fa49f671..05f6e5caffc9d3c31aac2433671f4d082611e7aa 100644 (file)
@@ -2193,7 +2193,6 @@ done:
    sorts of things, like timeval and itimerval.  */
 
 extern struct timezone sys_tz;
-extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
 
 asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz)
 {
@@ -2210,13 +2209,27 @@ asmlinkage int sys32_gettimeofday(struct compat_timeval *tv, struct timezone *tz
        return 0;
 }
 
+static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
+{
+       long usec;
+
+       if (!access_ok(VERIFY_READ, i, sizeof(*i)))
+               return -EFAULT;
+       if (__get_user(o->tv_sec, &i->tv_sec))
+               return -EFAULT;
+       if (__get_user(usec, &i->tv_usec))
+               return -EFAULT;
+       o->tv_nsec = usec * 1000;
+       return 0;
+}
+
 asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz)
 {
-       struct timeval ktv;
+       struct timespec kts;
        struct timezone ktz;
 
        if (tv) {
-               if (get_tv32(&ktv, tv))
+               if (get_ts32(&kts, tv))
                        return -EFAULT;
        }
        if (tz) {
@@ -2224,7 +2237,7 @@ asmlinkage int sys32_settimeofday(struct compat_timeval *tv, struct timezone *tz
                        return -EFAULT;
        }
 
-       return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL);
+       return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
 }
 
 asmlinkage int sys_utimes(char *, struct timeval *);
index 594d31bc2ae462432f81afb82cadb640a2da7390..1b564c56246289da628e6717f2280960a5b65331 100644 (file)
@@ -94,6 +94,7 @@ struct compat_statfs {
        s32             f_ffree;
        compat_fsid_t   f_fsid;
        s32             f_namelen;
+       s32             f_frsize;
        s32             f_spare[6];
 };