diff --git a/sysutils/whowatch/Makefile b/sysutils/whowatch/Makefile index c317d3b79b4f..3993123c7742 100644 --- a/sysutils/whowatch/Makefile +++ b/sysutils/whowatch/Makefile @@ -1,22 +1,22 @@ PORTNAME= whowatch -DISTVERSION= 1.8.6.2 +DISTVERSION= 1.8.6.3 CATEGORIES= sysutils MAINTAINER= jishanalam9128@gmail.com COMMENT= Displays information in real time about users currently logged on WWW= https://github.com/Zedai00/whowatch/ \ https://github.com/mtsuszycki/whowatch/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING USES= autoreconf ncurses USE_GITHUB= yes GH_ACCOUNT= Zedai00 GNU_CONFIGURE= yes PLIST_FILES= bin/whowatch \ share/applications/whowatch.desktop \ share/man/man1/whowatch.1.gz .include diff --git a/sysutils/whowatch/distinfo b/sysutils/whowatch/distinfo index 234467f6c041..cc2e1d6cc261 100644 --- a/sysutils/whowatch/distinfo +++ b/sysutils/whowatch/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1771524150 -SHA256 (Zedai00-whowatch-1.8.6.2_GH0.tar.gz) = b496a0ac8ec1b0fd282cfe3431eee34a0a6275b9fc93d95bb9cdb65f8cd70c39 -SIZE (Zedai00-whowatch-1.8.6.2_GH0.tar.gz) = 52538 +TIMESTAMP = 1774717110 +SHA256 (Zedai00-whowatch-1.8.6.3_GH0.tar.gz) = 491aedd57a8bbfd41000ee121ad5db236ff131196df0774ee7b5bbc5c7553703 +SIZE (Zedai00-whowatch-1.8.6.3_GH0.tar.gz) = 52997 diff --git a/sysutils/whowatch/files/patch-src_sysinfo__freebsd.c b/sysutils/whowatch/files/patch-src_sysinfo__freebsd.c deleted file mode 100644 index 08642fe6262a..000000000000 --- a/sysutils/whowatch/files/patch-src_sysinfo__freebsd.c +++ /dev/null @@ -1,121 +0,0 @@ ---- src/sysinfo_freebsd.c.orig 2026-02-19 17:57:59 UTC -+++ src/sysinfo_freebsd.c -@@ -5,10 +5,12 @@ - #include - #include - #include -+#include - #include - #include - #include - #include -+#include - #include - #include - #include -@@ -60,6 +62,25 @@ int sys_cpu_info(struct cpu_info_t *cur_cpu_info) { - return 0; - } - -+static uint64_t round1024(uint64_t val) { -+ return (val + 512) >> 10; -+} -+ -+static void sys_mem_info_print(char* name, uint64_t val, int pagesize, int isPages) { -+ uint64_t GiB, MiB, KiB, Bytes, Pages; -+ if (isPages) { -+ Pages = val; -+ Bytes = Pages * pagesize; -+ } else { -+ Bytes = val; -+ Pages = (pagesize <= 0 ? 0 : Bytes / pagesize); -+ } -+ KiB = round1024(Bytes); -+ MiB = round1024(KiB); -+ GiB = round1024(MiB); -+ println("%s|%5llu|%8llu|%11llu|%14llu|%11llu\n", name, GiB, MiB, KiB, Bytes, Pages); -+} -+ - // stole it from top - #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) - static void getsysctl(const char *name, void *ptr, size_t len) { -@@ -67,42 +88,54 @@ static void getsysctl(const char *name, void *ptr, siz - - sysctlbyname(name, ptr, &nlen, NULL, 0); - } --static int pageshift; --#define pagetok(size) ((size) << pageshift) - - void sys_mem_info(void) { - -- uint64_t physmem; -- int pagesize, v_free, v_active, v_inactive, v_cache, swap_total, swap_used; -+ uint64_t realmem, physmem, v_bufspace, swap_total_sysctl, swap_total = 0, swap_used = 0; -+ unsigned int pagesize, v_free, v_active, v_inactive, v_laundry, v_wire; -+ struct kvm_swap swapary[1]; -+ static kvm_t *kd = NULL; -+ int n; - -- GETSYSCTL("hw.pagesize", pagesize); -- -- pageshift = 0; -- int ps = pagesize; -- while (ps > 1) { -- pageshift++; -- ps >>= 1; -+ if (kd == NULL) { -+ kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); - } -- pageshift -= 10; // LOG1024 -+ if (kd != NULL) { -+ n = kvm_getswapinfo(kd, swapary, 1, 0); -+ if (n >= 0 && swapary[0].ksw_total != 0) { -+ swap_total = swapary[0].ksw_total; -+ swap_used = swapary[0].ksw_used; -+ } -+ } - -+ GETSYSCTL("hw.pagesize", pagesize); - GETSYSCTL("vm.stats.vm.v_free_count", v_free); - GETSYSCTL("vm.stats.vm.v_active_count", v_active); - GETSYSCTL("vm.stats.vm.v_inactive_count", v_inactive); -- GETSYSCTL("vm.stats.vm.v_cache_count", v_cache); -- GETSYSCTL("vm.swap_total", swap_total); -- GETSYSCTL("vm.swap_reserved", swap_used); -+ GETSYSCTL("vm.stats.vm.v_laundry_count", v_laundry); -+ GETSYSCTL("vm.stats.vm.v_wire_count", v_wire); -+ GETSYSCTL("vfs.bufspace", v_bufspace); -+ GETSYSCTL("vm.swap_total", swap_total_sysctl); -+ GETSYSCTL("hw.realmem", realmem); - GETSYSCTL("hw.physmem", physmem); - -- println("MemTotal: %llu kB\n", physmem / 1024); -- println("MemFree: %llu kB\n", pagetok(v_free)); -- println("MemAvailable: %llu kB\n", -- (uint64_t)(v_free + v_inactive + v_cache) * pagesize / 1024); -- println("Active: %llu kB\n", (uint64_t)v_active * pagesize / 1024); -- println("Inactive: %llu kB\n", (uint64_t)v_inactive * pagesize / 1024); -- println("Cached: %llu kB\n", (uint64_t)v_cache * pagesize / 1024); -- println("SwapTotal: %llu kB\n", (uint64_t)swap_total / 1024); -- println("SwapUsed: %llu kB\n", (uint64_t)swap_used / 1024); -- println("SwapFree: %llu kB\n", (uint64_t)(swap_total - swap_used) / 1024); -+ pagesize = (pagesize <= 0 ? 1 : pagesize); -+ -+ println("PageSize: %u Bytes\n", pagesize); -+ println( "Name | GiB | MiB | KiB | Bytes | Pages\n"); -+ sys_mem_info_print("RealMemTotal ", realmem, pagesize, 0); -+ sys_mem_info_print("PhysMemTotal ", physmem, pagesize, 0); -+ sys_mem_info_print("MemFree ", v_free, pagesize, 1); -+ sys_mem_info_print("MemAvailable ", v_free + v_inactive + v_laundry + v_bufspace / pagesize, pagesize, 1); -+ sys_mem_info_print("Active ", v_active, pagesize, 1); -+ sys_mem_info_print("Inactive ", v_inactive, pagesize, 1); -+ sys_mem_info_print("Laundry ", v_laundry, pagesize, 1); -+ sys_mem_info_print("Wired ", v_wire, pagesize, 1); -+ sys_mem_info_print("Buffers ", v_bufspace, pagesize, 0); -+ sys_mem_info_print("SwapTotal Real", swap_total_sysctl, pagesize, 0); -+ sys_mem_info_print("SwapTotal Phys", swap_total, pagesize, 1); -+ sys_mem_info_print("SwapUsed ", swap_used, pagesize, 1); -+ sys_mem_info_print("SwapFree ", swap_total - swap_used, pagesize, 1); - } - - long long sys_open_files() {