| Kernel v2.4.13-ac8 /kernel/sys.c |
|---|
 2.4.13-ac8
 kernel
 sys.c
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/kernel/sys.c linux.ac/kernel/sys.c
--- linux.vanilla/kernel/sys.c Tue Sep 18 22:10:43 2001
+++ linux.ac/kernel/sys.c Wed Oct 10 01:48:37 2001
@@ -791,16 +791,23 @@
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
* atomically safe type this is just fine. Conceptually its
* as if the syscall took an instant longer to occur.
*/
- if (tbuf)
- if (copy_to_user(tbuf, ¤t->times, sizeof(struct tms)))
+ if (tbuf) {
+ 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);
}
/*
|