summaryrefslogtreecommitdiff
path: root/components/ram.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-05-18 23:32:00 +0200
committerAaron Marcher <me@drkhsh.at>2018-05-18 23:32:00 +0200
commit49d1e5fae2e4957abcf0f1056b3e8df8d695094c (patch)
treef464f47cbd14d05b059880a3045943038344ee24 /components/ram.c
parent39ee31c2425d3ff79f88808cabf44c305d6849ab (diff)
Fix ram_free for Linux
Diffstat (limited to 'components/ram.c')
-rw-r--r--components/ram.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/ram.c b/components/ram.c
index 57081d2..f451601 100644
--- a/components/ram.c
+++ b/components/ram.c
@@ -9,7 +9,11 @@
{
long free;
- return (pscanf("/proc/meminfo", "MemFree: %ld kB\n", &free) == 1) ?
+ return (pscanf("/proc/meminfo",
+ "MemTotal: %ld kB\n"
+ "MemFree: %ld kB\n"
+ "MemAvailable: %ld kB\n",
+ &free, &free, &free) == 3) ?
bprintf("%f", (float)free / 1024 / 1024) : NULL;
}