#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
#if KERNEL_LINUX
/* _GNU_SOURCE is needed for struct shm_info.used_ids on musl libc */
status = semctl(/* id = */ 0, /* num = */ 0, SEM_INFO, arg);
if (status == -1) {
- char errbuf[1024];
ERROR("ipc plugin: semctl(2) failed: %s. "
"Maybe the kernel is not configured for semaphores?",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
return -1;
}
status = shmctl(/* id = */ 0, SHM_INFO, (void *)&shm_info);
if (status == -1) {
- char errbuf[1024];
ERROR("ipc plugin: shmctl(2) failed: %s. "
"Maybe the kernel is not configured for shared memory?",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ STRERRNO);
return -1;
}
pagesize_g = sysconf(_SC_PAGESIZE);
return 0;
}
-/* }}} */
-/* #endif KERNEL_LINUX */
+ /* }}} */
+ /* #endif KERNEL_LINUX */
#elif KERNEL_AIX
static caddr_t ipc_get_info(cid_t cid, int cmd, int version, int stsize,
if (get_ipc_info(cid, cmd, version, buff, &size) < 0) {
if (errno != ENOSPC) {
- char errbuf[1024];
- WARNING("ipc plugin: get_ipc_info: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("ipc plugin: get_ipc_info: %s", STRERRNO);
return NULL;
}
}
}
if (get_ipc_info(cid, cmd, version, buff, &size) < 0) {
- char errbuf[1024];
- WARNING("ipc plugin: get_ipc_info: %s",
- sstrerror(errno, errbuf, sizeof(errbuf)));
+ WARNING("ipc plugin: get_ipc_info: %s", STRERRNO);
free(buff);
return NULL;
}