version 1.28, 2002/07/02 03:05:47 |
version 1.29, 2003/06/12 22:30:23 |
|
|
int maxslp; |
int maxslp; |
|
|
int |
int |
getstathz() |
getstathz(void) |
{ |
{ |
struct clockinfo cinf; |
struct clockinfo cinf; |
size_t size = sizeof(cinf); |
size_t size = sizeof(cinf); |
|
|
} |
} |
|
|
int |
int |
machine_init(statics) |
machine_init(struct statics *statics) |
struct statics *statics; |
|
{ |
{ |
int pagesize; |
int pagesize; |
|
|
|
|
} |
} |
|
|
char * |
char * |
format_header(uname_field) |
format_header(char *uname_field) |
char *uname_field; |
|
{ |
{ |
char *ptr; |
char *ptr; |
|
|
|
|
static struct handle handle; |
static struct handle handle; |
|
|
struct kinfo_proc * |
struct kinfo_proc * |
getprocs(op, arg, cnt) |
getprocs(int op, int arg, int *cnt) |
int op, arg; |
|
int *cnt; |
|
{ |
{ |
size_t size = sizeof(int); |
size_t size = sizeof(int); |
int mib[4] = {CTL_KERN, KERN_PROC, op, arg}; |
int mib[4] = {CTL_KERN, KERN_PROC, op, arg}; |
|
|
} |
} |
|
|
caddr_t |
caddr_t |
get_process_info(si, sel, compare) |
get_process_info(struct system_info *si, struct process_select *sel, |
struct system_info *si; |
int (*compare)(const void *, const void *)) |
struct process_select *sel; |
|
int (*compare)(const void *, const void *); |
|
|
|
{ |
{ |
int show_idle, show_system, show_uid, show_command; |
int show_idle, show_system, show_uid, show_command; |
int total_procs, active_procs, i; |
int total_procs, active_procs, i; |
|
|
char fmt[MAX_COLS]; /* static area where result is built */ |
char fmt[MAX_COLS]; /* static area where result is built */ |
|
|
char * |
char * |
format_next_process(handle, get_userid) |
format_next_process(caddr_t handle, char *(*get_userid)()) |
caddr_t handle; |
|
char *(*get_userid)(); |
|
|
|
{ |
{ |
char waddr[sizeof(void *) * 2 + 3]; /* Hexify void pointer */ |
char waddr[sizeof(void *) * 2 + 3]; /* Hexify void pointer */ |
struct kinfo_proc *pp; |
struct kinfo_proc *pp; |
|
|
|
|
/* compare_cpu - the comparison function for sorting by cpu percentage */ |
/* compare_cpu - the comparison function for sorting by cpu percentage */ |
int |
int |
compare_cpu(v1, v2) |
compare_cpu(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
|
|
/* compare_size - the comparison function for sorting by total memory usage */ |
/* compare_size - the comparison function for sorting by total memory usage */ |
int |
int |
compare_size(v1, v2) |
compare_size(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
|
|
/* compare_res - the comparison function for sorting by resident set size */ |
/* compare_res - the comparison function for sorting by resident set size */ |
int |
int |
compare_res(v1, v2) |
compare_res(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
|
|
/* compare_time - the comparison function for sorting by CPU time */ |
/* compare_time - the comparison function for sorting by CPU time */ |
int |
int |
compare_time(v1, v2) |
compare_time(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
|
|
/* compare_prio - the comparison function for sorting by CPU time */ |
/* compare_prio - the comparison function for sorting by CPU time */ |
int |
int |
compare_prio(v1, v2) |
compare_prio(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
* reflects this ordering. |
* reflects this ordering. |
*/ |
*/ |
int |
int |
proc_compare(v1, v2) |
proc_compare(const void *v1, const void *v2) |
const void *v1, *v2; |
|
{ |
{ |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
|
|
* and "renice" commands. |
* and "renice" commands. |
*/ |
*/ |
int |
int |
proc_owner(pid) |
proc_owner(pid_t pid) |
pid_t pid; |
|
{ |
{ |
struct kinfo_proc **prefp, *pp; |
struct kinfo_proc **prefp, *pp; |
int cnt; |
int cnt; |
|
|
* to be based on the new swapctl(2) system call. |
* to be based on the new swapctl(2) system call. |
*/ |
*/ |
static int |
static int |
swapmode(used, total) |
swapmode(int *used, int *total) |
int *used; |
|
int *total; |
|
{ |
{ |
int nswap, rnswap, i; |
int nswap, rnswap, i; |
struct swapent *swdev; |
struct swapent *swdev; |