diff options
author | 諏訪子 <suwako@076.moe> | 2024-06-18 01:48:52 +0900 |
---|---|---|
committer | 諏訪子 <suwako@076.moe> | 2024-06-18 01:48:52 +0900 |
commit | e09858229410af502ff0b0b3ce000d0495641353 (patch) | |
tree | 31088399897874fce24814a49c266089c90216c6 | |
parent | a2bd4b2b5cee06e89084910171341e729fc215e2 (diff) |
FreeBSD: メモリ使用の修正
-rw-r--r-- | src/memory.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/memory.c b/src/memory.c index 833fa97..371e05c 100644 --- a/src/memory.c +++ b/src/memory.c @@ -31,6 +31,8 @@ void display_memory() { memused = run_mem_command("vmstat | awk 'END {printf $3}' | sed 's/M//'"); memtotal = run_mem_command("sysctl -n hw.physmem") / 1024LL / 1024LL; #elif defined(__FreeBSD__) || defined(__DragonFly__) + memused = run_mem_command("top | grep \"Mem:\" | awk '{print $2}' | " + "sed 's/M//'"); memtotal = run_mem_command("sysctl -n hw.physmem") / 1024LL / 1024LL; #elif defined(__NetBSD__) memused = run_mem_command("top | grep \"Memory:\" | awk '{print $2}' | " |