mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
Processes (NetBSD): add support
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user