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

Comparing projects/cms/source/ihost/libstatgrab/memory_stats.c (file contents):
Revision 1.2 by pajs, Thu May 16 10:34:23 2002 UTC vs.
Revision 1.4 by pajs, Thu May 16 17:02:43 2002 UTC

# Line 11 | Line 11
11   #include <sys/sysctl.h>
12   #include <unistd.h>
13   #endif
14 < #include <ukcprog.h>
14 > #include "ukcprog.h"
15  
16   char *get_memory_stats(){
17          long total=0;
# Line 95 | Line 95 | char *get_memory_stats(){
95                  errf("Failed to get free memory (%m)");
96                  return NULL;
97          }
98 +        if((kstat_close(kc)) != 0){
99 +                errf("Failed to close kstat control structure (%m)");
100 +                return NULL;
101 +        }      
102          total=((totalmem*pagesize)/1024)/1024;
103          free=(((kn->value.ul)*pagesize)/1024)/1024;
104          used=total-free;
# Line 156 | Line 160 | char *get_memory_stats(){
160                  return NULL;
161          }
162          return xml_memory_stats;
159 }
160
161 int main(){
162        printf("%s\n", get_memory_stats());
163        exit(0);
163   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines