aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/compat_linux.c')
-rw-r--r--arch/s390/kernel/compat_linux.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 9b471d785ec..4646382af34 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -279,22 +279,6 @@ asmlinkage long sys32_getegid16(void)
279 return high2lowgid(current->egid); 279 return high2lowgid(current->egid);
280} 280}
281 281
282/* 32-bit timeval and related flotsam. */
283
284static inline long get_tv32(struct timeval *o, struct compat_timeval __user *i)
285{
286 return (!access_ok(VERIFY_READ, o, sizeof(*o)) ||
287 (__get_user(o->tv_sec, &i->tv_sec) ||
288 __get_user(o->tv_usec, &i->tv_usec)));
289}
290
291static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
292{
293 return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) ||
294 (__put_user(i->tv_sec, &o->tv_sec) ||
295 __put_user(i->tv_usec, &o->tv_usec)));
296}
297
298/* 282/*
299 * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation. 283 * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation.
300 * 284 *
@@ -522,57 +506,6 @@ sys32_delete_module(const char __user *name_user, unsigned int flags)
522 506
523#endif /* CONFIG_MODULES */ 507#endif /* CONFIG_MODULES */
524 508
525/* Translations due to time_t size differences. Which affects all
526 sorts of things, like timeval and itimerval. */
527
528extern struct timezone sys_tz;
529
530asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
531{
532 if (tv) {
533 struct timeval ktv;
534 do_gettimeofday(&ktv);
535 if (put_tv32(tv, &ktv))
536 return -EFAULT;
537 }
538 if (tz) {
539 if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
540 return -EFAULT;
541 }
542 return 0;
543}
544
545static inline long get_ts32(struct timespec *o, struct compat_timeval __user *i)
546{
547 long usec;
548
549 if (!access_ok(VERIFY_READ, i, sizeof(*i)))
550 return -EFAULT;
551 if (__get_user(o->tv_sec, &i->tv_sec))
552 return -EFAULT;
553 if (__get_user(usec, &i->tv_usec))
554 return -EFAULT;
555 o->tv_nsec = usec * 1000;
556 return 0;
557}
558
559asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, struct timezone __user *tz)
560{
561 struct timespec kts;
562 struct timezone ktz;
563
564 if (tv) {
565 if (get_ts32(&kts, tv))
566 return -EFAULT;
567 }
568 if (tz) {
569 if (copy_from_user(&ktz, tz, sizeof(ktz)))
570 return -EFAULT;
571 }
572
573 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
574}
575
576asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, 509asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf,
577 size_t count, u32 poshi, u32 poslo) 510 size_t count, u32 poshi, u32 poslo)
578{ 511{