clamav/cmake/CheckMallinfo.c
John Humlick 18120a0ef0
clamd: Fix bug reporting memory stats, used by clamdtop
ClamD's STATS API reports process memory stats on systems that
provide the `mallinfo()` system call.
This feature is used by ClamDTOP to show process memory usage.
When we switched to the CMake build system, we neglected to add the
check for the `mallinfo()` system call and so broke ClamD memory
usage reporting.

This commit adds the CMake check for `mallinfo()` and sets
HAVE_MALLINFO, if found.

Fixes: https://github.com/Cisco-Talos/clamav/issues/706

Jira: CLAM-2742
2025-03-13 10:38:49 -07:00

8 lines
95 B
C

#include <malloc.h>
int main()
{
struct mallinfo mi;
mi = mallinfo();
return 0;
}