ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/process_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/process_stats.c (file contents):
Revision 1.11 by pajs, Thu Oct 9 19:40:03 2003 UTC vs.
Revision 1.12 by ats, Sun Oct 19 00:25:30 2003 UTC

# Line 45 | Line 45
45   #endif
46   #ifdef FREEBSD
47   #include <kvm.h>
48 #include <fcntl.h>
48   #include <sys/param.h>
49   #include <sys/sysctl.h>
50   #include <sys/user.h>
# Line 69 | Line 68 | process_stat_t *get_process_stats(){
68   #endif
69   #ifdef FREEBSD
70          struct kinfo_proc *kp_stats;    
71 <        kvm_t *kvmd = NULL;
71 >        kvm_t *kvmd;
72          int procs;
73   #endif
74  
# Line 135 | Line 134 | process_stat_t *get_process_stats(){
134          closedir(proc_dir);
135   #endif
136   #ifdef FREEBSD
137 <        if((kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL)) == NULL){
137 >        if((kvmd = get_kvm()) == NULL){
138                  return NULL;
139          }
140  
# Line 159 | Line 158 | process_stat_t *get_process_stats(){
158                  if (kp_stats[procs].kp_proc.p_stat == SSTOP) process_stat.stopped++;
159   #endif
160          }
162
163        kvm_close(kvmd);
161   #endif
162  
163          process_stat.total=process_stat.sleeping+process_stat.running+process_stat.zombie+process_stat.stopped;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines