summaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 5302297d8..4752c9ce6 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -605,6 +605,8 @@ asmlinkage int sys_setfsgid(gid_t gid)
asmlinkage long sys_times(struct tms * tbuf)
{
+ struct tms temp;
+
/*
* In the SMP world we might just be unlucky and have one of
* the times increment as we use it. Since the value is an
@@ -612,9 +614,13 @@ asmlinkage long sys_times(struct tms * tbuf)
* as if the syscall took an instant longer to occur.
*/
if (tbuf)
- if (copy_to_user(tbuf, &current->times, sizeof(struct tms)))
+ temp.tms_utime = HZ_TO_STD(current->times.tms_utime);
+ temp.tms_stime = HZ_TO_STD(current->times.tms_stime);
+ temp.tms_cutime = HZ_TO_STD(current->times.tms_cutime);
+ temp.tms_cstime = HZ_TO_STD(current->times.tms_cstime);
+ if (copy_to_user(tbuf, &temp, sizeof(struct tms)))
return -EFAULT;
- return jiffies;
+ return HZ_TO_STD(jiffies);
}
/*