The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/kernel/system/do_times.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* The kernel call implemented in this file:
    2  *   m_type:    SYS_TIMES
    3  *
    4  * The parameters for this kernel call are:
    5  *    m4_l1:    T_PROC_NR               (get info for this process)     
    6  *    m4_l1:    T_USER_TIME             (return values ...)     
    7  *    m4_l2:    T_SYSTEM_TIME   
    8  *    m4_l5:    T_BOOT_TICKS    
    9  */
   10 
   11 #include "../system.h"
   12 
   13 #if USE_TIMES
   14 
   15 /*===========================================================================*
   16  *                              do_times                                     *
   17  *===========================================================================*/
   18 PUBLIC int do_times(m_ptr)
   19 register message *m_ptr;        /* pointer to request message */
   20 {
   21 /* Handle sys_times().  Retrieve the accounting information. */
   22   register struct proc *rp;
   23   int proc_nr;
   24 
   25   /* Insert the times needed by the SYS_TIMES kernel call in the message. 
   26    * The clock's interrupt handler may run to update the user or system time
   27    * while in this code, but that cannot do any harm.
   28    */
   29   proc_nr = (m_ptr->T_PROC_NR == SELF) ? m_ptr->m_source : m_ptr->T_PROC_NR;
   30   if (isokprocn(proc_nr)) {
   31       rp = proc_addr(m_ptr->T_PROC_NR);
   32       m_ptr->T_USER_TIME   = rp->p_user_time;
   33       m_ptr->T_SYSTEM_TIME = rp->p_sys_time;
   34   }
   35   m_ptr->T_BOOT_TICKS = get_uptime();  
   36   return(OK);
   37 }
   38 
   39 #endif /* USE_TIMES */
   40 

Cache object: 005f55689891253bab0df5b83a4f4436


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.