diff options
Diffstat (limited to 'src/memory.c')
| -rw-r--r-- | src/memory.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/memory.c b/src/memory.c deleted file mode 100644 index 9e880d2..0000000 --- a/src/memory.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "../include/cfetch.h" - -void get_memory(system_info_t *info) { - FILE *file = fopen("/proc/meminfo", "r"); - - if (!file) { - perror("Error fopen meminfo"); - return; - } - - char line[256]; - long total = 0; - long available = 0; - - // read per line - while (fgets(line, sizeof(line), file)) { - if (sscanf(line, "MemTotal: %ld kB", &total) == 1) continue; - if (sscanf(line, "MemAvailable: %ld kB", &available) == 1) continue; - } - - fclose(file); - - printf("Memory: %.2f GB / %.2f GB\n", (total - available) / (1024.0 * 1024.0), total / (1024.0 * 1024.0)); - - return; -} |
