From 0cc8b55476648ca009147feddc276b7b3eb88dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Sat, 22 Jun 2024 03:22:25 +0900 Subject: =?UTF-8?q?SunOS:=20=E3=83=A1=E3=83=A2=E3=83=AA=E6=83=85=E5=A0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/memory.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/memory.c b/src/memory.c index 879fef7..3696a62 100644 --- a/src/memory.c +++ b/src/memory.c @@ -25,6 +25,13 @@ void display_memory() { memused = run_command_lld("top | grep \"Memory:\" | awk '{print $2}' | " "sed 's/M//'"); memtotal = run_command_lld("sysctl -n hw.physmem64") / 1024LL / 1024LL; +#elif defined(__sun) + // Memory: 3993M phys mem, 504M free mem, + memused = run_command_lld("top | grep \"Memory:\" | awk '{print $5}' | " + "sed 's/M//'"); + memtotal = run_command_lld("top | grep \"Memory:\" | awk '{print $2}' | " + "sed 's/M//'"); + /* memtotal = run_command_lld("sysctl -n hw.physmem64") / 1024LL / 1024LL; */ #elif defined(__minix) memtotal = run_command_lld("sysctl -n hw.physmem") / 1024LL / 1024LL; #elif defined(__linux__) -- cgit v1.2.3