Files
fastfetch/src/common/sysctl.h
T

18 lines
669 B
C
Raw Normal View History

2022-09-19 21:31:50 +02:00
#pragma once
#include "fastfetch.h"
2022-10-27 10:46:33 +08:00
2022-09-19 23:16:43 +02:00
#include <sys/types.h>
2022-09-19 21:45:39 +02:00
#include <sys/sysctl.h>
2022-09-19 21:31:50 +02:00
2024-10-04 15:58:17 +08:00
#ifdef __OpenBSD__
const char* ffSysctlGetString(int mib1, int mib2, FFstrbuf* result);
2026-04-09 16:20:59 +08:00
FF_A_NODISCARD int ffSysctlGetInt(int mib1, int mib2, int defaultValue);
FF_A_NODISCARD int64_t ffSysctlGetInt64(int mib1, int mib2, int64_t defaultValue);
2024-10-04 15:58:17 +08:00
#else
2022-10-27 10:46:33 +08:00
const char* ffSysctlGetString(const char* propName, FFstrbuf* result);
2026-04-09 16:20:59 +08:00
FF_A_NODISCARD int ffSysctlGetInt(const char* propName, int defaultValue);
FF_A_NODISCARD int64_t ffSysctlGetInt64(const char* propName, int64_t defaultValue);
2024-10-04 15:58:17 +08:00
#endif
2026-04-09 16:20:59 +08:00
FF_A_NODISCARD void* ffSysctlGetData(int* request, u_int requestLength, size_t* resultLength);