From: Jens Axboe Date: Mon, 11 Jul 2011 08:25:35 +0000 (+0200) Subject: Fill in os_phys_mem() stub for HP-UX X-Git-Tag: fio-1.56~10 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8c9ca2e6fe5a400fcba3a7dd45a33effea8298e0;ds=sidebyside Fill in os_phys_mem() stub for HP-UX Signed-off-by: Jens Axboe --- diff --git a/os/os-hpux.h b/os/os-hpux.h index 38a1441d..c65fea69 100644 --- a/os/os-hpux.h +++ b/os/os-hpux.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include @@ -57,16 +59,17 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) static inline unsigned long long os_phys_mem(void) { -#if 0 - long mem = sysconf(_SC_AIX_REALMEM); + unsigned long long ret; + struct pst_static pst; + union pstun pu; - if (mem == -1) + pu.pst_static = &pst; + if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1) return 0; - return (unsigned long long) mem * 1024; -#else - return 0; -#endif + ret = pst.physical_memory; + ret *= pst.page_size; + return ret; } #define FIO_HAVE_CPU_ONLINE_SYSCONF