sysctlInt
fn
int sysctlInt(string name) @safeGets system information using sysctl.
This function provides a safe wrapper around the sysctl syscall.
Parameters
name | Name of the sysctl value to retrieve (e.g., "hw.ncpu"). |
Returns
Integer value from sysctl.
Throws
Exception if sysctl fails.
Example:
auto ncpu = sysctlInt("hw.ncpu");
writeln("CPU count: ", ncpu);