Skip to content

Commit 5fdc924

Browse files
committed
Swap (macOS): detect detailed info
1 parent 3d4a117 commit 5fdc924

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/detection/swap/swap_apple.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
#include <mach/mach.h>
44
#include <sys/sysctl.h>
55

6-
const char* ffDetectSwap(FFSwapResult* swap)
6+
const char* ffDetectSwap(FFlist* result)
77
{
88
struct xsw_usage xsw;
99
size_t size = sizeof(xsw);
1010
if(sysctl((int[]){ CTL_VM, VM_SWAPUSAGE }, 2, &xsw, &size, NULL, 0) != 0)
1111
return "Failed to read vm.swapusage";
1212

13+
FFSwapResult* swap = ffListAdd(result);
14+
ffStrbufInitStatic(&swap->name, xsw.xsu_encrypted ? "Encrypted" : "Normal");
1315
swap->bytesTotal = xsw.xsu_total;
1416
swap->bytesUsed = xsw.xsu_used;
1517
return NULL;

0 commit comments

Comments
 (0)