sysctlInt

fnint sysctlInt(string name) @safe

Gets system information using sysctl.

This function provides a safe wrapper around the sysctl syscall.

Parameters

nameName 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);