From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: [PATCH] s390 (2/7): 31 bit compat.
Date: Fri, 27 Jun 2003 17:04:48 +0200 [thread overview]
Message-ID: <20030627150448.GC3591@mschwid3.boeblingen.de.ibm.com> (raw)
- Add missing includes to compat_ioctl.c.
- Fix 32 bit emulation of sys_settimeofday.
diffstat:
arch/s390/kernel/compat_ioctl.c | 3 +++
arch/s390/kernel/compat_linux.c | 21 +++++++++++++++++----
include/asm-s390/compat.h | 1 +
3 files changed, 21 insertions(+), 4 deletions(-)
diff -urN linux-2.5/arch/s390/kernel/compat_ioctl.c linux-2.5-s390/arch/s390/kernel/compat_ioctl.c
--- linux-2.5/arch/s390/kernel/compat_ioctl.c Sun Jun 22 20:32:58 2003
+++ linux-2.5-s390/arch/s390/kernel/compat_ioctl.c Fri Jun 27 16:04:37 2003
@@ -42,12 +42,15 @@
#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>
diff -urN linux-2.5/arch/s390/kernel/compat_linux.c linux-2.5-s390/arch/s390/kernel/compat_linux.c
--- linux-2.5/arch/s390/kernel/compat_linux.c Sun Jun 22 20:33:08 2003
+++ linux-2.5-s390/arch/s390/kernel/compat_linux.c Fri Jun 27 16:04:37 2003
@@ -2193,7 +2193,6 @@
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 @@
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 @@
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 *);
diff -urN linux-2.5/include/asm-s390/compat.h linux-2.5-s390/include/asm-s390/compat.h
--- linux-2.5/include/asm-s390/compat.h Sun Jun 22 20:32:34 2003
+++ linux-2.5-s390/include/asm-s390/compat.h Fri Jun 27 16:04:37 2003
@@ -94,6 +94,7 @@
s32 f_ffree;
compat_fsid_t f_fsid;
s32 f_namelen;
+ s32 f_frsize;
s32 f_spare[6];
};
reply other threads:[~2003-06-27 14:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030627150448.GC3591@mschwid3.boeblingen.de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®