Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / kernel / system / do_times.c
blobd2bac1b73e5cbee5498da5c6fc7a6aed7f9e3edd
1 /* The kernel call implemented in this file:
2 * m_type: SYS_TIMES
4 * The parameters for this kernel call are:
5 * m_lsys_krn_sys_times.endpt (get info for this process)
6 * m_krn_lsys_sys_times.user_time (return values ...)
7 * m_krn_lsys_sys_times.system_time
8 * m_krn_lsys_sys_times.boot_time
9 * m_krn_lsys_sys_times.boot_ticks
10 * m_krn_lsys_sys_times.real_ticks
13 #include "kernel/system.h"
15 #include <minix/endpoint.h>
17 #if USE_TIMES
19 /*===========================================================================*
20 * do_times *
21 *===========================================================================*/
22 int do_times(struct proc * caller, message * m_ptr)
24 /* Handle sys_times(). Retrieve the accounting information. */
25 register const struct proc *rp;
26 int proc_nr;
27 endpoint_t e_proc_nr;
29 /* Insert the times needed by the SYS_TIMES kernel call in the message.
30 * The clock's interrupt handler may run to update the user or system time
31 * while in this code, but that cannot do any harm.
33 e_proc_nr = (m_ptr->m_lsys_krn_sys_times.endpt == SELF) ?
34 caller->p_endpoint : m_ptr->m_lsys_krn_sys_times.endpt;
35 if(e_proc_nr != NONE && isokendpt(e_proc_nr, &proc_nr)) {
36 rp = proc_addr(proc_nr);
37 m_ptr->m_krn_lsys_sys_times.user_time = rp->p_user_time;
38 m_ptr->m_krn_lsys_sys_times.system_time = rp->p_sys_time;
40 m_ptr->m_krn_lsys_sys_times.boot_ticks = get_monotonic();
41 m_ptr->m_krn_lsys_sys_times.real_ticks = get_realtime();
42 m_ptr->m_krn_lsys_sys_times.boot_time = get_boottime();
43 return(OK);
46 #endif /* USE_TIMES */