std/sys/info
The std/sys/info module provides utilities for retrieving system identification and information, wrapping POSIX uname.
Overview
- System Identification: Access OS name, kernel version, hardware architecture, and more.
- RAII Compliance: The
Unamestruct automatically manages the memory for its internal strings.
Usage
import "std/sys/info.zc"
import "std/io.zc"
fn main() {
let info = SysInfo::get_uname();
println(f"OS: ");
println(f"Kernel: ");
println(f"Arch: ");
}
Struct Definition
Uname
Contains system identification fields.
struct Uname {
sysname: String;
nodename: String;
release: String;
version: String;
machine: String;
}
Methods
SysInfo Methods
| Method | Signature | Description |
|---|---|---|
| get_uname | SysInfo::get_uname() -> Uname | Returns a Uname struct containing various system strings. |
Memory Management
Unameimplementsimpl Dropand will automatically free its internalStringbuffers when it goes out of scope.