Package oshi.util.platform.unix.openbsd
Class OpenBsdSysctlUtil
- java.lang.Object
-
- oshi.util.platform.unix.openbsd.OpenBsdSysctlUtil
-
@ThreadSafe public final class OpenBsdSysctlUtil extends java.lang.Object
Provides access to sysctl calls on OpenBSD
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOG
private static java.lang.String
SYSCTL_FAIL
private static java.lang.String
SYSCTL_N
-
Constructor Summary
Constructors Modifier Constructor Description private
OpenBsdSysctlUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.sun.jna.Memory
sysctl(int[] name)
Executes a sysctl call with a Pointer resultstatic int
sysctl(int[] name, int def)
Executes a sysctl call with an int resultstatic long
sysctl(int[] name, long def)
Executes a sysctl call with a long resultstatic boolean
sysctl(int[] name, com.sun.jna.Structure struct)
Executes a sysctl call with a Structure resultstatic java.lang.String
sysctl(int[] name, java.lang.String def)
Executes a sysctl call with a String resultstatic int
sysctl(java.lang.String name, int def)
Executes a sysctl call with an int resultstatic long
sysctl(java.lang.String name, long def)
Executes a sysctl call with a long resultstatic java.lang.String
sysctl(java.lang.String name, java.lang.String def)
Executes a sysctl call with a String result
-
-
-
Field Detail
-
SYSCTL_N
private static final java.lang.String SYSCTL_N
- See Also:
- Constant Field Values
-
LOG
private static final org.slf4j.Logger LOG
-
SYSCTL_FAIL
private static final java.lang.String SYSCTL_FAIL
- See Also:
- Constant Field Values
-
-
Method Detail
-
sysctl
public static int sysctl(int[] name, int def)
Executes a sysctl call with an int result- Parameters:
name
- name of the sysctldef
- default int value- Returns:
- The int result of the call if successful; the default otherwise
-
sysctl
public static long sysctl(int[] name, long def)
Executes a sysctl call with a long result- Parameters:
name
- name of the sysctldef
- default long value- Returns:
- The long result of the call if successful; the default otherwise
-
sysctl
public static java.lang.String sysctl(int[] name, java.lang.String def)
Executes a sysctl call with a String result- Parameters:
name
- name of the sysctldef
- default String value- Returns:
- The String result of the call if successful; the default otherwise
-
sysctl
public static boolean sysctl(int[] name, com.sun.jna.Structure struct)
Executes a sysctl call with a Structure result- Parameters:
name
- name of the sysctlstruct
- structure for the result- Returns:
- True if structure is successfuly populated, false otherwise
-
sysctl
public static com.sun.jna.Memory sysctl(int[] name)
Executes a sysctl call with a Pointer result- Parameters:
name
- name of the sysctl- Returns:
- An allocated memory buffer containing the result on success, null otherwise. Its value on failure is undefined.
-
sysctl
public static int sysctl(java.lang.String name, int def)
Executes a sysctl call with an int result- Parameters:
name
- name of the sysctldef
- default int value- Returns:
- The int result of the call if successful; the default otherwise
-
sysctl
public static long sysctl(java.lang.String name, long def)
Executes a sysctl call with a long result- Parameters:
name
- name of the sysctldef
- default long value- Returns:
- The long result of the call if successful; the default otherwise
-
sysctl
public static java.lang.String sysctl(java.lang.String name, java.lang.String def)
Executes a sysctl call with a String result- Parameters:
name
- name of the sysctldef
- default String value- Returns:
- The String result of the call if successful; the default otherwise
-
-