Files
fastfetch/src/common/sysctl.h
T

18 lines
734 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
2026-09-17 21:00:36 +08:00
// `result` is always written to, and `propName` is always read by the sysctl wrapper.
2024-10-04 15:58:17 +08:00
#ifdef __OpenBSD__
2026-09-17 21:00:36 +08:00
[[gnu::nonnull(3)]] const char* ffSysctlGetString(int mib1, int mib2, FFstrbuf* result);
[[nodiscard]] int ffSysctlGetInt(int mib1, int mib2, int defaultValue);
[[nodiscard]] int64_t ffSysctlGetInt64(int mib1, int mib2, int64_t defaultValue);
2024-10-04 15:58:17 +08:00
#else
2026-09-17 21:00:36 +08:00
[[gnu::nonnull(1, 2)]] const char* ffSysctlGetString(const char* propName, FFstrbuf* result);
[[gnu::nonnull(1), nodiscard]] int ffSysctlGetInt(const char* propName, int defaultValue);
[[gnu::nonnull(1), nodiscard]] int64_t ffSysctlGetInt64(const char* propName, int64_t defaultValue);
2024-10-04 15:58:17 +08:00
#endif