Add support for MemAvailable (!10)

MemAvailable is in /proc/meminfo since Linux 3.14.

This aligns the reported memory usage with the memory usage
reported by xfce4-systemload-plugin.

Closes !10
This commit is contained in:
Jan Ziak
2020-09-14 16:07:24 +02:00
committed by Andre Miranda
parent e3ba69c187
commit bed04577a5
7 changed files with 50 additions and 35 deletions

View File

@@ -25,12 +25,13 @@ static gushort _cpu_count = 0;
*/
gboolean
get_memory_usage (guint64 *memory_total, guint64 *memory_free, guint64 *memory_cache, guint64 *memory_buffers, guint64 *swap_total, guint64 *swap_free)
get_memory_usage (guint64 *memory_total, guint64 *memory_available, guint64 *memory_free, guint64 *memory_cache, guint64 *memory_buffers, guint64 *swap_total, guint64 *swap_free)
{
*memory_total = 0;
*memory_free = 0;
*memory_cache = 0;
*memory_buffers = 0;
*memory_available = 0;
*swap_total = 0;
*swap_free = 0;