From 64b9f69fb147f093c8b37b17ce8597f92abbc1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 26 Oct 2022 17:29:53 +0800 Subject: [PATCH] Swap: support freebsd --- src/detection/swap/swap_bsd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/swap/swap_bsd.c b/src/detection/swap/swap_bsd.c index 8af98a16f..8e8089600 100644 --- a/src/detection/swap/swap_bsd.c +++ b/src/detection/swap/swap_bsd.c @@ -1,6 +1,8 @@ #include "swap.h" +#include "common/sysctl.h" void ffDetectSwapImpl(FFMemoryStorage* swap) { - ffStrbufAppendS(&swap->error, "Not implemented"); + swap->bytesTotal = (uint64_t)ffSysctlGetInt64("vm.swap_total", 0); + swap->bytesUsed = (uint64_t)ffSysctlGetInt64("vm.swap_reserved", 0); }