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.4 by tdb, Fri Feb 28 22:59:35 2003 UTC

# Line 24 | Line 24
24  
25   #include <stdio.h>
26   #include "statgrab.h"
27 #ifdef LINUX
28 #include <string.h>
29 #endif
27   #ifdef SOLARIS
28   #include <unistd.h>
29   #include <kstat.h>
30   #endif
34 #ifdef FREEBSD
35 #include <sys/types.h>
36 #include <sys/sysctl.h>
37 #include <unistd.h>
38 #endif
39 #include "ukcprog.h"
31  
32   mem_stat_t *get_memory_stats(){
33  
# Line 71 | Line 62 | mem_stat_t *get_memory_stats(){
62          if((kn=kstat_data_lookup(ksp, "freemem")) == NULL){
63                  return NULL;
64          }
65 <        if((kstat_close(kc)) != 0){
66 <                return NULL;
76 <        }      
65 >        kstat_close(kc);
66 >
67          mem_stat.total = (long long)totalmem * (long long)pagesize;
68          mem_stat.free = ((long long)kn->value.ul) * (long long)pagesize;
69          mem_stat.used = mem_stat.total - mem_stat.free;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines