head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.2 pkgsrc-2026Q1-base:1.1; locks; strict; comment @// @; 1.1 date 2025.12.23.08.48.26; author markd; state Exp; branches; next ; commitid 9stRw5miHttjKvnG; desc @@ 1.1 log @plasma6-kinfocenter: add version 6.5.2 KInfoCenter is a utility that provides information about a computer system. @ text @$NetBSD$ get Memory for NetBSD --- kcms/about-distro/src/MemoryEntry.cpp.orig 2025-11-04 14:59:20.000000000 +0000 +++ kcms/about-distro/src/MemoryEntry.cpp @@@@ -12,8 +12,9 @@@@ #ifdef UDEV_FOUND #include #endif -#elif defined(Q_OS_FREEBSD) +#elif defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) // clang-format off +#include #include #include // clang-format on @@@@ -58,6 +59,11 @@@@ std::optional MemoryEntry::ca } return totalBytes; +#elif defined(Q_OS_OPENBSD) + long phys_pages = sysconf(_SC_PHYS_PAGES); + long pagesize = sysconf(_SC_PAGESIZE); + if (phys_pages != -1 && pagesize != -1) + return ((uint64_t)phys_pages * (uint64_t)pagesize); #endif /* @@@@ -86,6 +92,15 @@@@ std::optional MemoryEntry::ca if (sysctlbyname("hw.physmem", &memory, &len, NULL, 0) == 0) { return memory; } +#elif defined(Q_OS_NETBSD) + /* Stuff for sysctl */ + size_t len; + + unsigned long memory; + len = sizeof(memory); + if (sysctlbyname("hw.physmem64", &memory, &len, NULL, 0) == 0) { + return memory; + } #endif return {}; @