Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.13-ac8 /kernel/sys.c

Filename:/kernel/sys.c
Lines Added:10
Lines Deleted:3
Also changed in: (Previous) 2.4.13-ac7  2.4.13-ac6  2.4.13-ac5  2.4.13-ac4  2.4.13-ac3  2.4.13-ac1 
(Following) 2.4.18-pre7  2.4.18-pre7-ac3  2.4.18-pre8  2.4.18-pre9  2.4.18-pre9-ac1  2.4.18-pre9-ac2 

Location
[  2.4.13-ac8
  [  kernel
     o  sys.c

Patch

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);
 }
 
 /*


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.