lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [v3] y2038: introduce struct __kernel_old_timeval
On Thu, 15 Mar 2018, Arnd Bergmann wrote:
> + * legacy timeval structure, only embedded in structures that
> + * traditionally used 'timeval' to pass time intervals (not absolute
> + * times). Do not add new users. If user space fails to compile
> + * here, this is probably because it is not y2038 safe and needs to
> + * be changed to use another interface.
> + */
> +struct __kernel_old_timeval {
> + __kernel_long_t tv_sec;
> + __kernel_long_t tv_usec;
> +};
> +
> +/*
> * The IDs of the various system clocks (for POSIX.1b interval timers):
> */
> #define CLOCK_REALTIME 0
> diff --git a/kernel/time/time.c b/kernel/time/time.c
> index 5db8f15ec056..6fa99213fc72 100644
> --- a/kernel/time/time.c
> +++ b/kernel/time/time.c
> @@ -486,6 +486,18 @@ struct timeval ns_to_timeval(const s64 nsec)
> }
> EXPORT_SYMBOL(ns_to_timeval);
>
> +struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec)
> +{
> + struct timespec64 ts = ns_to_timespec64(nsec);
> + struct __kernel_old_timeval tv;
> +
> + tv.tv_sec = ts.tv_sec;

We might think about adding some debug aid here which yells when ts.tv_sec
is > than the cutoff.

Hmm?

tglx


\
 
 \ /
  Last update: 2018-03-16 01:02    [W:0.668 / U:3.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site