summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
author諏訪子 <suwako@076.moe>2024-06-22 03:22:25 +0900
committer諏訪子 <suwako@076.moe>2024-06-22 03:22:25 +0900
commit0cc8b55476648ca009147feddc276b7b3eb88dfa (patch)
tree1056f8e4e559332833138284caf7f61a5aa66c8b /src/memory.c
parentf0274e6ba6f43d4909f3b0240ba0fad50418debe (diff)
SunOS: メモリ情報
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c7
1 files changed, 7 insertions, 0 deletions
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__)