diff options
Diffstat (limited to 'kernel/time.c')
-rw-r--r-- | kernel/time.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/time.c b/kernel/time.c index e325597f5bf5..5b81da08bbdb 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -57,17 +57,14 @@ EXPORT_SYMBOL(sys_tz); | |||
57 | */ | 57 | */ |
58 | asmlinkage long sys_time(time_t __user * tloc) | 58 | asmlinkage long sys_time(time_t __user * tloc) |
59 | { | 59 | { |
60 | /* | 60 | time_t i; |
61 | * We read xtime.tv_sec atomically - it's updated | 61 | struct timespec tv; |
62 | * atomically by update_wall_time(), so no need to | ||
63 | * even read-lock the xtime seqlock: | ||
64 | */ | ||
65 | time_t i = xtime.tv_sec; | ||
66 | 62 | ||
67 | smp_rmb(); /* sys_time() results are coherent */ | 63 | getnstimeofday(&tv); |
64 | i = tv.tv_sec; | ||
68 | 65 | ||
69 | if (tloc) { | 66 | if (tloc) { |
70 | if (put_user(i, tloc)) | 67 | if (put_user(i,tloc)) |
71 | i = -EFAULT; | 68 | i = -EFAULT; |
72 | } | 69 | } |
73 | return i; | 70 | return i; |