From 5fdc924b5d91da59952e91e1af3b0685d0750a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 4 Jun 2025 15:07:05 +0800 Subject: [PATCH] Swap (macOS): detect detailed info --- src/detection/swap/swap_apple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detection/swap/swap_apple.c b/src/detection/swap/swap_apple.c index 07bb477ee..b9e7f7b9c 100644 --- a/src/detection/swap/swap_apple.c +++ b/src/detection/swap/swap_apple.c @@ -3,13 +3,15 @@ #include #include -const char* ffDetectSwap(FFSwapResult* swap) +const char* ffDetectSwap(FFlist* result) { struct xsw_usage xsw; size_t size = sizeof(xsw); if(sysctl((int[]){ CTL_VM, VM_SWAPUSAGE }, 2, &xsw, &size, NULL, 0) != 0) return "Failed to read vm.swapusage"; + FFSwapResult* swap = ffListAdd(result); + ffStrbufInitStatic(&swap->name, xsw.xsu_encrypted ? "Encrypted" : "Normal"); swap->bytesTotal = xsw.xsu_total; swap->bytesUsed = xsw.xsu_used; return NULL;