diff options
Diffstat (limited to 'arch/x86/ia32/sys_ia32.c')
-rw-r--r-- | arch/x86/ia32/sys_ia32.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 4d3ad8d78a4d..2e09dcd3c0a6 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -367,75 +367,11 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static inline long get_tv32(struct timeval *o, struct compat_timeval __user *i) | ||
371 | { | ||
372 | int err = -EFAULT; | ||
373 | |||
374 | if (access_ok(VERIFY_READ, i, sizeof(*i))) { | ||
375 | err = __get_user(o->tv_sec, &i->tv_sec); | ||
376 | err |= __get_user(o->tv_usec, &i->tv_usec); | ||
377 | } | ||
378 | return err; | ||
379 | } | ||
380 | |||
381 | static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i) | ||
382 | { | ||
383 | int err = -EFAULT; | ||
384 | |||
385 | if (access_ok(VERIFY_WRITE, o, sizeof(*o))) { | ||
386 | err = __put_user(i->tv_sec, &o->tv_sec); | ||
387 | err |= __put_user(i->tv_usec, &o->tv_usec); | ||
388 | } | ||
389 | return err; | ||
390 | } | ||
391 | |||
392 | asmlinkage long sys32_alarm(unsigned int seconds) | 370 | asmlinkage long sys32_alarm(unsigned int seconds) |
393 | { | 371 | { |
394 | return alarm_setitimer(seconds); | 372 | return alarm_setitimer(seconds); |
395 | } | 373 | } |
396 | 374 | ||
397 | /* | ||
398 | * Translations due to time_t size differences. Which affects all | ||
399 | * sorts of things, like timeval and itimerval. | ||
400 | */ | ||
401 | asmlinkage long sys32_gettimeofday(struct compat_timeval __user *tv, | ||
402 | struct timezone __user *tz) | ||
403 | { | ||
404 | if (tv) { | ||
405 | struct timeval ktv; | ||
406 | |||
407 | do_gettimeofday(&ktv); | ||
408 | if (put_tv32(tv, &ktv)) | ||
409 | return -EFAULT; | ||
410 | } | ||
411 | if (tz) { | ||
412 | if (copy_to_user(tz, &sys_tz, sizeof(sys_tz))) | ||
413 | return -EFAULT; | ||
414 | } | ||
415 | return 0; | ||
416 | } | ||
417 | |||
418 | asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv, | ||
419 | struct timezone __user *tz) | ||
420 | { | ||
421 | struct timeval ktv; | ||
422 | struct timespec kts; | ||
423 | struct timezone ktz; | ||
424 | |||
425 | if (tv) { | ||
426 | if (get_tv32(&ktv, tv)) | ||
427 | return -EFAULT; | ||
428 | kts.tv_sec = ktv.tv_sec; | ||
429 | kts.tv_nsec = ktv.tv_usec * NSEC_PER_USEC; | ||
430 | } | ||
431 | if (tz) { | ||
432 | if (copy_from_user(&ktz, tz, sizeof(ktz))) | ||
433 | return -EFAULT; | ||
434 | } | ||
435 | |||
436 | return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); | ||
437 | } | ||
438 | |||
439 | struct sel_arg_struct { | 375 | struct sel_arg_struct { |
440 | unsigned int n; | 376 | unsigned int n; |
441 | unsigned int inp; | 377 | unsigned int inp; |