Files
fastfetch/src/detection/processes/processes_nbsd.c
T
李通洲 e0eba8ce21 Chore: run clang-format
```bash
find . -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) ! -path "src/3rdparty/*" -print0 | xargs -0 clang-format -i
```
2026-03-29 10:03:32 +08:00

16 lines
455 B
C

#include "processes.h"
#include <sys/sysctl.h>
const char* ffDetectProcesses(uint32_t* result) {
int request[] = {CTL_KERN, KERN_PROC2, KERN_PROC_ALL, -1, sizeof(struct kinfo_proc2), 0};
size_t length = 0;
if (sysctl(request, ARRAY_SIZE(request), NULL, &length, NULL, 0) != 0) {
return "sysctl({CTL_KERN, KERN_PROC2, KERN_PROC_ALL}) failed";
}
*result = (uint32_t) (length / sizeof(struct kinfo_proc2));
return NULL;
}