Package oshi.util.platform.unix.freebsd
Class BsdSysctlUtil
java.lang.Object
oshi.util.platform.unix.freebsd.BsdSysctlUtil
@ThreadSafe public final class BsdSysctlUtil extends java.lang.Object
Provides access to sysctl calls on FreeBSD
-
Method Summary
Modifier and Type Method Description static 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 boolean
sysctl(java.lang.String name, com.sun.jna.Structure struct)
Executes a sysctl call with a Structure resultstatic java.lang.String
sysctl(java.lang.String name, java.lang.String def)
Executes a sysctl call with a String result
-
Method Details
-
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
-
sysctl
public static boolean sysctl(java.lang.String 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
-