59 |
|
#include <unistd.h> |
60 |
|
#define SWAP_BATCH 5 |
61 |
|
#endif |
62 |
+ |
#ifdef AIX |
63 |
+ |
#include <unistd.h> |
64 |
+ |
#include <libperfstat.h> |
65 |
+ |
#endif |
66 |
|
#ifdef WIN32 |
67 |
|
#include <windows.h> |
68 |
|
#endif |
99 |
|
#if defined(NETBSD) || defined(OPENBSD) |
100 |
|
struct uvmexp *uvm; |
101 |
|
#endif |
102 |
+ |
#ifdef AIX |
103 |
+ |
perfstat_memory_total_t mem; |
104 |
+ |
long long pagesize; |
105 |
+ |
#endif |
106 |
|
#ifdef WIN32 |
107 |
|
MEMORYSTATUSEX memstats; |
108 |
|
#endif |
143 |
|
} |
144 |
|
swapidx = pstat_swapinfo[num - 1].pss_idx + 1; |
145 |
|
} |
146 |
+ |
#endif |
147 |
+ |
#ifdef AIX |
148 |
+ |
if ((pagesize = sysconf(_SC_PAGESIZE)) == -1) { |
149 |
+ |
sg_set_error_with_errno(SG_ERROR_SYSCONF, "_SC_PAGESIZE"); |
150 |
+ |
return NULL; |
151 |
+ |
} |
152 |
+ |
|
153 |
+ |
/* return code is number of structures returned */ |
154 |
+ |
if(perfstat_memory_total(NULL, &mem, sizeof(perfstat_memory_total_t), 1) != 1) { |
155 |
+ |
sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "perfstat_memory_total"); |
156 |
+ |
return NULL; |
157 |
+ |
} |
158 |
+ |
|
159 |
+ |
swap_stat.total = ((long long)mem.pgsp_total) * pagesize; |
160 |
+ |
swap_stat.free = ((long long)mem.pgsp_free) * pagesize; |
161 |
+ |
swap_stat.used = swap_stat.total - swap_stat.free; |
162 |
|
#endif |
163 |
|
#ifdef SOLARIS |
164 |
|
if((pagesize=sysconf(_SC_PAGESIZE)) == -1){ |