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.30 by tdb, Mon Nov 1 18:30:17 2004 UTC vs.
Revision 1.31 by ats, Sat Nov 6 14:55:53 2004 UTC

# Line 56 | Line 56 | sg_mem_stats *sg_get_mem_stats(){
56          static sg_mem_stats mem_stat;
57  
58   #ifdef HPUX
59 <        struct pst_static pstat_static;
59 >        struct pst_static *pstat_static;
60          struct pst_dynamic pstat_dynamic;
61          long long pagesize;
62   #endif
# Line 95 | Line 95 | sg_mem_stats *sg_get_mem_stats(){
95                  sg_set_error_with_errno(SG_ERROR_PSTAT, "pstat_dynamic");
96                  return NULL;
97          }
98 <        if (pstat_getstatic(&pstat_static, sizeof(pstat_static), 1, 0) == -1) {
99 <                sg_set_error_with_errno(SG_ERROR_PSTAT, "pstat_static");
98 >        pstat_static = sg_get_pstat_static();
99 >        if (pstat_static == NULL) {
100                  return NULL;
101          }
102  
103 <        mem_stat.total = ((long long) pstat_static.physical_memory) * pagesize;
103 >        /* FIXME Does this include swap? */
104 >        mem_stat.total = ((long long) pstat_static->physical_memory) * pagesize;
105          mem_stat.free = ((long long) pstat_dynamic.psd_free) * pagesize;
106          mem_stat.used = mem_stat.total - mem_stat.free;
107   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines