Host
A host.
class Host
Getting Hosts
static var current: `Self`
The current host.
Getting Basic Info
var kernelVersion: String
The kernel version for the host.
var pageSize: vm_size_t
The page size for the host.
var bootInfo: String
The boot info for the host.
var isPrivileged: Bool
Wether the host port is privileged.
Getting Processors
var processors: [Mach.Processor]
The processors in the host.
var processorSets: [Mach.ProcessorSet]
The processor sets in the host.
Rebooting the Host
struct HostRebootOption
A reboot option.
func reboot(option: Mach.HostRebootOption
) throws Reboots the host.
Getting Info
struct HostInfoManager
A host info manager.
struct HostInfoFlavor
A flavor of host info.
var info: Mach.HostInfoManager
The host’s info.
Getting Statistics
struct HostStatisticsManager
A host statistics manager.
struct HostStatisticsFlavor
A flavor of host statistics.
var statistics: Mach.HostStatisticsManager
The host’s statistics.
Making Kext Requests
func kextRequest(Data
) throws -> Data Performs a kext request.
Getting Special Ports
struct HostSpecialPort
A special port for a host.
func getSpecialPort<PortType>(Mach.HostSpecialPort, as: PortType.Type
) throws -> PortType Gets a special port for the host.
func setSpecialPort(Mach.HostSpecialPort, to: Mach.Port
) throws Sets a special port for the host.
var hostPort: Mach.Host
The unprivileged host port.
var hostPortPrivileged: Mach.Host
The privileged host port.
Getting Lock Groups
Darwin/lockgroup_info
var lockGroupInfos: [lockgroup_info]
Information about the lock groups on the host.
Managing Memory
class MemoryManager
A memory manager.
func getDefaultMemoryManager(
) throws -> Mach.MemoryManager Gets the default memory manager for the host.
func setDefaultMemoryManager(to: Mach.MemoryManager
) throws Sets the default memory manager for the host.
Getting Clocks
func clock(Mach.ClockType
) throws -> Mach.Clock Obtains a clock.
var calendarClock: Mach.Clock
The calendar clock (POSIX time).
var systemClock: Mach.Clock
The system clock (uptime).
Getting Zones
struct Zone
A zone.
var zones: [Mach.Zone]
The zones in the host.
Getting Memory Info
Darwin/mach_memory_info
var memoryInfos: [mach_memory_info]
The memory infos in the host.