The following changes since commit c63e8658bb776f2d50cde992ad07232a61e6d031: Merge branch 'fdp/pid_limit_fix' of https://github.com/ankit-sam/fio (2024-07-17 17:30:14 -0400) are available in the Git repository at: git://git.kernel.dk/fio.git master for you to fetch changes up to 40176e3206288e36f01baea86b15d7ff450c3e00: Merge branch 'qnx-phys-mem' of https://github.com/mvf/fio (2024-07-26 07:56:01 -0600) ---------------------------------------------------------------- Jens Axboe (1): Merge branch 'qnx-phys-mem' of https://github.com/mvf/fio Matthias von Faber (1): QNX: Fix physical memory detection os/os-qnx.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- Diff of recent changes: diff --git a/os/os-qnx.h b/os/os-qnx.h index 447c9957..8ae9695e 100755 --- a/os/os-qnx.h +++ b/os/os-qnx.h @@ -9,7 +9,7 @@ #include <sys/statvfs.h> #include <sys/ioctl.h> #include <sys/utsname.h> -#include <sys/sysctl.h> +#include <sys/syspage.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/dcmd_cam.h> @@ -71,11 +71,17 @@ static inline int blockdev_invalidate_cache(struct fio_file *f) static inline unsigned long long os_phys_mem(void) { - int mib[2] = { CTL_HW, HW_PHYSMEM64 }; - uint64_t mem; - size_t len = sizeof(mem); + uint64_t mem = 0; + const char *const strings = SYSPAGE_ENTRY(strings)->data; + const struct asinfo_entry *const begin = SYSPAGE_ENTRY(asinfo); + const struct asinfo_entry *const end = begin + SYSPAGE_ENTRY_SIZE(asinfo) / SYSPAGE_ELEMENT_SIZE(asinfo); - sysctl(mib, 2, &mem, &len, NULL, 0); + assert(SYSPAGE_ELEMENT_SIZE(asinfo) == sizeof(struct asinfo_entry)); + + for (const struct asinfo_entry *e = begin; e < end; ++e) { + if (!strcmp(strings + e->name, "ram")) + mem += e->end - e->start + 1; + } return mem; }