#define CHECKED_SYSCONF_SYSCALL(sysconf_name) \
if (-1 == (res##sysconf_name = sysconf(sysconf_name))) \
SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot get sysconf(" #sysconf_name "), errno: %s", \
ret = SYSINFO_RET_FAIL; \
#ifdef HAVE_VMINFO_T_UPDATES
#include "../common/stats.h"
static int vm_memory_total(AGENT_RESULT *result)
long res_SC_PHYS_PAGES, res_SC_PAGESIZE;
zabbix_log(LOG_LEVEL_DEBUG, "In %s", __func__);
CHECKED_SYSCONF_SYSCALL(_SC_PHYS_PAGES);
CHECKED_SYSCONF_SYSCALL(_SC_PAGESIZE);
SET_UI64_RESULT(result, (zbx_uint64_t)res_SC_PHYS_PAGES * res_SC_PAGESIZE);
zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __func__, zbx_result_string(ret));
#ifndef HAVE_VMINFO_T_UPDATES
static int vm_memory_used(AGENT_RESULT *result)
long res_SC_PHYS_PAGES, res_SC_AVPHYS_PAGES, res_SC_PAGESIZE;
zabbix_log(LOG_LEVEL_DEBUG, "In %s, (no HAVE_VMINFO_T_UPDATES)", __func__);
CHECKED_SYSCONF_SYSCALL(_SC_PHYS_PAGES);
CHECKED_SYSCONF_SYSCALL(_SC_AVPHYS_PAGES);
CHECKED_SYSCONF_SYSCALL(_SC_PAGESIZE);
used = res_SC_PHYS_PAGES - res_SC_AVPHYS_PAGES;