tuklib_physmem.c | tuklib_physmem.c | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
# include <os2.h> | # include <os2.h> | |||
#elif defined(__DJGPP__) | #elif defined(__DJGPP__) | |||
# include <dpmi.h> | # include <dpmi.h> | |||
#elif defined(__VMS) | #elif defined(__VMS) | |||
# include <lib$routines.h> | # include <lib$routines.h> | |||
# include <syidef.h> | # include <syidef.h> | |||
# include <ssdef.h> | # include <ssdef.h> | |||
#elif defined(AMIGA) || defined(__AROS__) | ||||
# define __USE_INLINE__ | ||||
# include <proto/exec.h> | ||||
// AIX | // AIX | |||
#elif defined(TUKLIB_PHYSMEM_AIX) | #elif defined(TUKLIB_PHYSMEM_AIX) | |||
# include <sys/systemcfg.h> | # include <sys/systemcfg.h> | |||
#elif defined(TUKLIB_PHYSMEM_SYSCONF) | #elif defined(TUKLIB_PHYSMEM_SYSCONF) | |||
# include <unistd.h> | # include <unistd.h> | |||
#elif defined(TUKLIB_PHYSMEM_SYSCTL) | #elif defined(TUKLIB_PHYSMEM_SYSCTL) | |||
# ifdef HAVE_SYS_PARAM_H | # ifdef HAVE_SYS_PARAM_H | |||
# include <sys/param.h> | # include <sys/param.h> | |||
skipping to change at line 121 | skipping to change at line 125 | |||
&& meminfo.total_number_of_physical_pages | && meminfo.total_number_of_physical_pages | |||
!= (unsigned long)-1) | != (unsigned long)-1) | |||
ret = (uint64_t)meminfo.total_number_of_physical_pages * 409 6; | ret = (uint64_t)meminfo.total_number_of_physical_pages * 409 6; | |||
#elif defined(__VMS) | #elif defined(__VMS) | |||
int vms_mem; | int vms_mem; | |||
int val = SYI$_MEMSIZE; | int val = SYI$_MEMSIZE; | |||
if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL) | if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL) | |||
ret = (uint64_t)vms_mem * 8192; | ret = (uint64_t)vms_mem * 8192; | |||
#elif defined(AMIGA) || defined(__AROS__) | ||||
ret = AvailMem(MEMF_TOTAL); | ||||
#elif defined(TUKLIB_PHYSMEM_AIX) | #elif defined(TUKLIB_PHYSMEM_AIX) | |||
ret = _system_configuration.physmem; | ret = _system_configuration.physmem; | |||
#elif defined(TUKLIB_PHYSMEM_SYSCONF) | #elif defined(TUKLIB_PHYSMEM_SYSCONF) | |||
const long pagesize = sysconf(_SC_PAGESIZE); | const long pagesize = sysconf(_SC_PAGESIZE); | |||
const long pages = sysconf(_SC_PHYS_PAGES); | const long pages = sysconf(_SC_PHYS_PAGES); | |||
if (pagesize != -1 && pages != -1) | if (pagesize != -1 && pages != -1) | |||
// According to docs, pagesize * pages can overflow. | // According to docs, pagesize * pages can overflow. | |||
// Simple case is 32-bit box with 4 GiB or more RAM, | // Simple case is 32-bit box with 4 GiB or more RAM, | |||
// which may report exactly 4 GiB of RAM, and "long" | // which may report exactly 4 GiB of RAM, and "long" | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |