|
System.BSD.Sysctl | Portability | portable | Stability | stable | Maintainer | mhenrion@gmail.com |
|
|
|
|
|
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.
On some platforms, there are sysctl nodes that accept parameters via
additional components in the OID (see for instance the "kern.proc.pid"
sysctl described in sysctl(3) on FreeBSD). The sysctlNameToOidArgs
function makes it easy to query such nodes as well.
Nodes may be queried either by their OID as a list of integers, by their
binary OID for maximum speed, or by their names on platforms that support it.
|
|
Synopsis |
|
|
|
|
The data types
|
|
|
The class of types that can be used to identify a sysctl node.
| | Instances | |
|
|
|
An efficient representation of a sysctl OID for maximum performance.
| Instances | |
|
|
OID creation and extraction
|
|
|
Get the OID corresponding to a sysctl name.
|
|
|
Like sysctlNameToOid, but allows to provide a list of
additional integers to append to the OID, for specific sysctl
nodes that support parameters this way.
|
|
|
Prepare an OID for later use.
|
|
|
Extract the list of integers contained in an OID.
|
|
Basic reading functions
|
|
|
Read a signed integer from a sysctl (the C int type).
|
|
|
Read an unsigned integer from a sysctl (the C unsigned int type).
|
|
|
Read a signed long integer from a sysctl (the C long type).
|
|
|
Read an unsigned long integer from a sysctl (the C unsigned long type).
|
|
|
Read a signed 64-bit integer from a sysctl.
|
|
|
Read an unsigned 64-bit integer from a sysctl.
|
|
|
Read a string from a sysctl. If the string can possibly change with
time, use sysctlPeekArray for characters instead.
|
|
Advanced reading functions
|
|
|
Read a storable value from a sysctl node.
This is useful to read binary values such as C structures, otherwise
the ad-hoc reading functions should be used instead.
|
|
|
Like sysctlPeek, but allows to retrieve a list of elements whose
length can possibly change at runtime.
|
|
Basic writing functions
|
|
|
Write a signed integer to a sysctl (the C int type).
|
|
|
Write an unsigned integer to a sysctl (the C unsigned int type).
|
|
|
Write a signed long integer to a sysctl (the C long type).
|
|
|
Write an unsigned long integer to a sysctl (the C unsigned long type).
|
|
|
Write a signed 64-bit integer to a sysctl.
|
|
|
Write an unsigned 64-bit integer to a sysctl.
|
|
|
Write a string to a sysctl.
|
|
Advanced writing functions
|
|
|
Write a storable value to a sysctl node.
This is useful to write binary values such as C structures, otherwise
the ad-hoc writing functions should be used instead.
|
|
Produced by Haddock version 2.6.0 |