|
59 | 59 | #pragma comment(lib, "psapi.lib") |
60 | 60 | #endif |
61 | 61 |
|
62 | | -#if defined(AIXPPC) |
| 62 | +#if defined(_AIX) |
63 | 63 | #include <unistd.h> |
64 | 64 | #include <alloca.h> |
65 | 65 | #include <procinfo.h> |
@@ -315,7 +315,7 @@ int64 MemoryPlugin::getProcessPhysicalMemorySize() { |
315 | 315 | size_t size = t_info.resident_size; |
316 | 316 | return size; |
317 | 317 |
|
318 | | -#elif defined(AIXPPC) |
| 318 | +#elif defined(_AIX) |
319 | 319 | /* |
320 | 320 | * There is no API on AIX to get the rss of the shared memory used by this process. |
321 | 321 | * If such an API was available, this function should return the following: |
@@ -367,7 +367,7 @@ int64 MemoryPlugin::getProcessPrivateMemorySize() { |
367 | 367 | } |
368 | 368 | } |
369 | 369 | #undef SHARED_FIELD_INDEX |
370 | | -#elif defined(AIXPPC) |
| 370 | +#elif defined(_AIX) |
371 | 371 | struct procentry64 pe; |
372 | 372 | pid_t pid = getpid(); |
373 | 373 |
|
@@ -416,7 +416,7 @@ int64 MemoryPlugin::getProcessVirtualMemorySize() { |
416 | 416 | task_info(current_task(), TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count); |
417 | 417 | size_t size = t_info.virtual_size; |
418 | 418 | return size; |
419 | | -#elif defined(AIXPPC) |
| 419 | +#elif defined(_AIX) |
420 | 420 | /* There is no API on AIX to get shared memory usage for the process. If such an |
421 | 421 | * API existed, we could return getProcessPrivateMemorySize() + sharedSize here. |
422 | 422 | * |
@@ -459,7 +459,7 @@ int64 MemoryPlugin::getFreePhysicalMemorySize() { |
459 | 459 | } |
460 | 460 | return vm_stat.free_count*pageSize; |
461 | 461 |
|
462 | | -#elif defined(AIXPPC) |
| 462 | +#elif defined(_AIX) && !defined(__PASE__) |
463 | 463 | /* NOTE: This works on AIX 5.3 and later. */ |
464 | 464 | IDATA numPageSizes = vmgetinfo(NULL, VMINFO_GETPSIZES, 0); |
465 | 465 |
|
@@ -496,13 +496,18 @@ int64 MemoryPlugin::getFreePhysicalMemorySize() { |
496 | 496 | return statex.ullAvailPhys; |
497 | 497 | } |
498 | 498 | return -1; |
| 499 | +#elif defined (__PASE__) |
| 500 | + //TODO: Working on PASE Implementation |
| 501 | + //AIXPPC implementation fails on PASE ... |
| 502 | + // ...@ line 482 size never gets changed therefore -1 is returned |
| 503 | + return -1; |
499 | 504 | #else |
500 | 505 | return -1; |
501 | 506 | #endif |
502 | 507 | } |
503 | 508 |
|
504 | 509 | int64 MemoryPlugin::getTotalPhysicalMemorySize() { |
505 | | -#if defined (_AIX) |
| 510 | +#if defined (_AIX) && !defined(__PASE__) |
506 | 511 | return (int64)(sysconf(_SC_AIX_REALMEM) * 1024); |
507 | 512 |
|
508 | 513 | #elif defined(_LINUX) ||defined(__MACH__)&&defined(_SC_PAGESIZE)&&defined(_SC_PHYS_PAGES) ||defined(__APPLE__)&&defined(_SC_PAGESIZE)&&defined(_SC_PHYS_PAGES) |
@@ -558,6 +563,11 @@ int64 MemoryPlugin::getTotalPhysicalMemorySize() { |
558 | 563 | #elif defined(_S390) |
559 | 564 | /* Get_Physical_Memory returns "SIZE OF ACTUAL REAL STORAGE ONLINE IN 'K'" */ |
560 | 565 | return Get_Physical_Memory() * 1024; |
| 566 | +#elif defined (__PASE__) |
| 567 | + //TODO: Working on PASE implementation. |
| 568 | + //AIX implementation: sysconf(_SC_AIX_REALMEM) returns -1 |
| 569 | + //errno is set to 109 Function not implemented POSIX |
| 570 | + return -1; |
561 | 571 | #else |
562 | 572 | return -1; |
563 | 573 | #endif |
|
0 commit comments