mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
Processes (NetBSD): add support
This commit is contained in:
parent
cb403be8e5
commit
b410710903
@ -727,7 +727,7 @@ elseif(NetBSD)
|
||||
src/detection/os/os_nbsd.c
|
||||
src/detection/packages/packages_obsd.c
|
||||
src/detection/poweradapter/poweradapter_nosupport.c
|
||||
src/detection/processes/processes_nosupport.c
|
||||
src/detection/processes/processes_nbsd.c
|
||||
src/detection/gtk_qt/qt.c
|
||||
src/detection/sound/sound_linux.c
|
||||
src/detection/swap/swap_obsd.c
|
||||
|
15
src/detection/processes/processes_nbsd.c
Normal file
15
src/detection/processes/processes_nbsd.c
Normal file
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user