diff options
| author | Anser <rostgans@tutamail.com> | 2026-08-11 00:18:57 +0200 |
|---|---|---|
| committer | Anser <rostgans@tutamail.com> | 2026-08-11 00:18:57 +0200 |
| commit | eb6f986361713d6ce47c6d4572bb24d9f6207ddf (patch) | |
| tree | 3fca62d5cad785acce36a46a660219840c959932 /src/modules/memory/memory.c | |
| parent | 9ad584b5762433f7c99d7cc7b65ad21ebe4ff932 (diff) | |
TOBESQUISHED: safe in reconstruction of the codes layout and rework of information handeling also ascii art printing
Diffstat (limited to 'src/modules/memory/memory.c')
| -rw-r--r-- | src/modules/memory/memory.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/modules/memory/memory.c b/src/modules/memory/memory.c deleted file mode 100644 index 62eeafe..0000000 --- a/src/modules/memory/memory.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <stdio.h> -#include "memory.h" - -char *memory(void) { - FILE *file = fopen("/proc/meminfo", "r"); - - if (!file) { - perror("Error fopen meminfo"); - return NULL; - } - - 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 0; -} |
