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 |
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 |