diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-01-02 13:28:47 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-02-07 00:13:27 +0100 |
commit | 4d5f007eedb74d71a7bde2bff69b6a31ad8ab427 (patch) | |
tree | 9704984d9137621c8bdbba2e1c86018e5d3c755f /kernel/time/posix-timers.c | |
parent | syscalls: remove obsolete __IGNORE_ macros (diff) | |
download | linux-4d5f007eedb74d71a7bde2bff69b6a31ad8ab427.tar.xz linux-4d5f007eedb74d71a7bde2bff69b6a31ad8ab427.zip |
time: make adjtime compat handling available for 32 bit
We want to reuse the compat_timex handling on 32-bit architectures the
same way we are using the compat handling for timespec when moving to
64-bit time_t.
Move all definitions related to compat_timex out of the compat code
into the normal timekeeping code, along with a rename to old_timex32,
corresponding to the timespec/timeval structures, and make it controlled
by CONFIG_COMPAT_32BIT_TIME, which 32-bit architectures will then select.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'kernel/time/posix-timers.c')
-rw-r--r-- | kernel/time/posix-timers.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 0e84bb72a3da..8955f32f2a36 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1123,12 +1123,8 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock, return err; } -#endif - -#ifdef CONFIG_COMPAT - COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock, - struct compat_timex __user *, utp) + struct old_timex32 __user *, utp) { const struct k_clock *kc = clockid_to_kclock(which_clock); struct timex ktx; @@ -1139,22 +1135,18 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock, if (!kc->clock_adj) return -EOPNOTSUPP; - err = compat_get_timex(&ktx, utp); + err = get_old_timex32(&ktx, utp); if (err) return err; err = kc->clock_adj(which_clock, &ktx); if (err >= 0) - err = compat_put_timex(utp, &ktx); + err = put_old_timex32(utp, &ktx); return err; } -#endif - -#ifdef CONFIG_COMPAT_32BIT_TIME - COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock, struct old_timespec32 __user *, tp) { |