Source
zabbix_log(LOG_LEVEL_DEBUG, "sysconf(_SC_PAGESIZE) failed, errno is: %s", zbx_strerror(errno));
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern ZBX_COLLECTOR_DATA *collector;
static kstat_ctl_t *kc = NULL;
static kid_t kc_id = 0;
static kstat_t *kc_vminfo;
static zbx_mutex_t kstat_lock = ZBX_MUTEX_NULL;
/******************************************************************************
* *
* Purpose: refreshes kstat environment *
* *
* Parameters: error - [OUT] the error message *
* *
* Return value: SUCCEED - the kstat environment was refreshed successfully *
* FAIL - otherwise *
* *
******************************************************************************/
static int zbx_kstat_refresh(char **error)
{
int ret;
kid_t kid;
zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
if (-1 == (kid = kstat_chain_update(kc)))
{
*error = zbx_dsprintf(*error, "failed to update kstat chain: %s", zbx_strerror(errno));
ret = FAIL;
goto out;
}
if (0 != kid)
kc_id = kid;