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

Comparing projects/libstatgrab/src/libstatgrab/memory_stats.c (file contents):
Revision 1.1 by pajs, Tue Feb 18 19:28:30 2003 UTC vs.
Revision 1.3 by tdb, Thu Feb 20 13:19:52 2003 UTC

# Line 36 | Line 36
36   #include <sys/sysctl.h>
37   #include <unistd.h>
38   #endif
39 #include "ukcprog.h"
39  
40   mem_stat_t *get_memory_stats(){
41  
# Line 71 | Line 70 | mem_stat_t *get_memory_stats(){
70          if((kn=kstat_data_lookup(ksp, "freemem")) == NULL){
71                  return NULL;
72          }
73 <        if((kstat_close(kc)) != 0){
74 <                return NULL;
76 <        }      
73 >        kstat_close(kc);
74 >
75          mem_stat.total = (long long)totalmem * (long long)pagesize;
76          mem_stat.free = ((long long)kn->value.ul) * (long long)pagesize;
77          mem_stat.used = mem_stat.total - mem_stat.free;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines