[sys/info] Initial version.

This commit is contained in:
Jeroen van Rijn
2022-09-01 00:43:47 +02:00
parent 317db2758a
commit d5f94d73ad
8 changed files with 618 additions and 2 deletions
+38
View File
@@ -0,0 +1,38 @@
package sysinfo
when !(ODIN_ARCH == .amd64 || ODIN_ARCH == .i386 || ODIN_ARCH == .arm32 || ODIN_ARCH == .arm64) {
#assert(false, "This package is unsupported on this architecture.")
}
os_version: OS_Version
ram: RAM
OS_Version_Platform :: enum {
Unknown,
Windows,
Linux,
MacOS,
iOS,
FreeBSD,
OpenBSD,
NetBSD,
}
OS_Version :: struct {
platform: OS_Version_Platform,
major: int,
minor: int,
patch: int,
build: [2]int,
version: string,
as_string: string,
}
RAM :: struct {
total_ram: int,
free_ram: int,
total_swap: int,
free_swap: int,
}