]> Zhao Yanbai Git Server - minix.git/commitdiff
Cycle counters zeroed after fork for the child
authorTomas Hruby <tom@minix3.org>
Fri, 18 Jun 2010 14:01:34 +0000 (14:01 +0000)
committerTomas Hruby <tom@minix3.org>
Fri, 18 Jun 2010 14:01:34 +0000 (14:01 +0000)
kernel/system/do_fork.c

index 4a1180cc61ef01a78a8375783923eeebdb2332fa..248d18f7c915df15bbcb312c5ea8348d7cb9f065 100644 (file)
@@ -15,6 +15,7 @@
 #include <assert.h>
 
 #include <minix/endpoint.h>
+#include <minix/u64.h>
 
 #if USE_FORK
 
@@ -94,6 +95,9 @@ PUBLIC int do_fork(struct proc * caller, message * m_ptr)
   if (rpc->p_scheduler)
          RTS_SET(rpc, RTS_NO_QUANTUM);
 
+  make_zero64(rpc->p_cpu_time_left);
+  make_zero64(rpc->p_cycles);
+
   /* If the parent is a privileged process, take away the privileges from the 
    * child process and inhibit it from running by setting the NO_PRIV flag.
    * The caller should explicitely set the new privileges before executing.