bsd-sysctl-1.0.0: Access to the BSD sysctl(3) interface

Portabilityportable
Stabilitystable
Maintainermhenrion@gmail.com

System.BSD.Sysctl

Contents

Description

This module allows access to the BSD sysctl(3) interface via the Haskell FFI.

Convenience functions to read and write the usual sysctl types are provided, as well as more advanced functions to handle binary values given a suitable Storable instance. It is also possible to retrieve data whose size changes at runtime with the sysctlPeekArray function.

Nodes may be queried either by their name, their OID as a list of Ints, or by an OID returned by sysctlNameToOid if speed is a concern.

Synopsis

The data types

data OID Source

Instances

Name to OID conversion

Basic reading functions

Advanced reading functions

sysctlPeek :: forall k a. (SysctlKey k, Storable a) => k -> IO aSource

sysctlPeekArray :: forall k a. (SysctlKey k, Storable a) => k -> IO [a]Source

Basic writing functions

Advanced writing functions

sysctlPoke :: (SysctlKey k, Storable a) => k -> a -> IO ()Source