lkml.org 
[lkml]   [2015]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v2 2/9] time: Provide y2106 safe get_seconds() replacement
From
On 14 January 2015 at 04:42, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Tue, 13 Jan 2015, Xunlei Pang wrote:
>
>> From: Xunlei Pang <pang.xunlei@linaro.org>
>>
>> As part of addressing "y2038 problem" for in-kernel uses, this
>> patch adds safe get_seconds64() using time64_t.
>>
>> After this patch, get_seconds() is deprecated and all its call sites
>> will be fixed using get_seconds64(), after that it can be removed.
>
> Why another interface?
>
> We already have ktime_get_real_seconds(). That handles 32bit
> correctly, while your new function does not.
>
> You cannot return a 64bit value unprotected against updates on 32bit,
> unless you want to implement a RNG.

Yes, ktime_get_real_seconds() should be used instead.

Thanks,
Xunlei


\
 
 \ /
  Last update: 2015-01-14 16:21    [W:0.053 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site