lkml.org 
[lkml]   [2015]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Y2038] [PATCH v4 06/25] time/posix-timers:Introduce {get, put}_timespec and {get, put}_itimerspec
On Thu, 4 Jun 2015, Arnd Bergmann wrote:
> int get_timespec64(struct timespec64 *ts, const struct timespec __user *uts)
> {
> struct timespec64 tmp;
> int ret;
>
> if (sizeof(tmp) == sizeof(*ts))
> return copy_from_user(&tmp, uts, sizeof(*ts)) ? -EFAULT : 0;
>
> ret = copy_from_user(&tmp, uts, sizeof(*ts));
> if (ret)
> return -EFAULT;
>
> ts->tv_sec = tmp.tv_sec;
> ts->tv_nsec = tmp.tv_nsec;
>
> return 0;
> }
>
> This works fine, but I'd have to change it to copy from a __user
> __kernel_timespec instead of timespec in my system call series, and
> in order to do that, we must ensure that I can change over all callers
> at the same time, so with the function prototype above, we should not
> start using get_timespec64 for anything outside of posix-timers.c.

That's fine I think.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-06-05 12:21    [W:0.076 / U:2.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site