From eb6f986361713d6ce47c6d4572bb24d9f6207ddf Mon Sep 17 00:00:00 2001 From: Anser Date: Tue, 11 Aug 2026 00:18:57 +0200 Subject: TOBESQUISHED: safe in reconstruction of the codes layout and rework of information handeling also ascii art printing --- src/os.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/os.c (limited to 'src/os.c') diff --git a/src/os.c b/src/os.c new file mode 100644 index 0000000..fd5b7ae --- /dev/null +++ b/src/os.c @@ -0,0 +1,18 @@ +#include "../include/cfetch.h" + +#include + +void get_os(system_info_t *info) { +#ifdef __linux__ + struct utsname u; + + if (uname(&u) == 0) { + size_t length = printf("OS: %s %s %s %s\n", u.sysname, u.release, u.version, u.machine); + printf("line length: %ld\n", length); + } else { + perror("Error while accessing uname"); + return; + } +#endif + return; +} -- cgit v1.2.3