Top Description Inners Fields Methods
com.sun.jna.platform.unix.solaris

public Interface LibKstat

extends Library
Imports
java.util.Arrays, .List, com.sun.jna.Library, .Native, .Pointer, .Structure, .Structure.FieldOrder, .Union

Kstat library. The kstat facility is a general-purpose mechanism for providing kernel statistics to users.
Author
widdis[at]gmail[dot]com

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
LibKstat.Kstat

The kernel maintains a linked list of statistics structures, or kstats.

public static class
LibKstat.KstatCtl

A kstat control structure.

public static class
LibKstat.KstatIntr

Interrupt statistics.

public static class
LibKstat.KstatIO

IO Statistics.

public static class
LibKstat.KstatNamed

A list of arbitrary name=value statistics.

public static class
LibKstat.KstatTimer

Event timer statistics.

Field Summary

Modifier and TypeField and Description
public static final int
public static final LibKstat
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final byte
public static final byte
public static final byte
public static final byte
public static final byte
Inherited from com.sun.jna.Library:
OPTION_ALLOW_OBJECTSOPTION_CALLING_CONVENTIONOPTION_CLASSLOADEROPTION_FUNCTION_MAPPEROPTION_INVOCATION_MAPPEROPTION_OPEN_FLAGSOPTION_STRING_ENCODINGOPTION_STRUCTURE_ALIGNMENTOPTION_SYMBOL_PROVIDEROPTION_TYPE_MAPPER

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the new KCID if the kstat chain has changed, 0 if it hasn't, or -1 on failure.
kstat_chain_update
(LibKstat.KstatCtl
a kstat control structure
kc
)

The kstat_chain_update() function brings the user's kstat header chain in sync with that of the kernel.

public int

Returns:

0 on success and -1 on failure.
kstat_close
(LibKstat.KstatCtl
a kstat control structure
kc
)

The kstat_close() function frees all resources that were associated with kc.

public Pointer

Returns:

a pointer to the requested data record if it is found. If the requested record is not found, or if the kstat type is invalid, returns NULL.
kstat_data_lookup
(LibKstat.Kstat
The kstat to search
ksp
,
String
The key for the name-value pair, or name of the timer as applicable
name
)

The kstat_data_lookup() function searches the kstat's data section for the record with the specified name .

public LibKstat.Kstat

Returns:

a pointer to the requested kstat if it is found, or NULL if it is not.
kstat_lookup
(LibKstat.KstatCtl
The kstat control structure
kc
,
String
The kstat module to search
ks_module
,
int
The kstat instance number
ks_instance
,
String
The kstat name to search
ks_name
)

The kstat_lookup() function traverses the kstat chain, kc.kc_chain, searching for a kstat with the same ks_module, ks_instance, and ks_name fields; this triplet uniquely identifies a kstat.

public LibKstat.KstatCtl

Returns:

A pointer to this structure, which must be supplied as the kc argument in subsequent libkstat function calls.
kstat_open
()

The kstat_open() function initializes a kstat control structure, which provides access to the kernel statistics library.

public int

Returns:

On success, return the current kstat chain ID (KCID). On failure, return -1.
kstat_read
(LibKstat.KstatCtl
The kstat control structure
kc
,
LibKstat.Kstat
The kstat from which to retrieve data
ksp
,
Pointer
If buf is non-NULL , the data is copied from ksp.ks_data into buf.
p
)

kstat_read() gets data from the kernel for the kstat pointed to by ksp.

public int

Returns:

On success, return the current kstat chain ID (KCID). On failure, return -1.
kstat_write
(LibKstat.KstatCtl
The kstat control structure
kc
,
LibKstat.Kstat
The kstat on which to set data
ksp
,
Pointer
If buf is non-NULL, the data is copied from buf into ksp.ks_data.
buf
)

kstat_write() writes data from buf, or from ksp.ks_data if buf is NULL, to the corresponding kstat in the kernel.