public interface CLibrary
extends com.sun.jna.Library
| Modifier and Type | Interface and Description |
|---|---|
static class |
CLibrary.Addrinfo |
static class |
CLibrary.Sockaddr |
static class |
CLibrary.Timeval
Return type for BSD sysctl kern.boottime
|
| Modifier and Type | Field and Description |
|---|---|
static int |
AI_CANONNAME |
| Modifier and Type | Method and Description |
|---|---|
void |
freeaddrinfo(com.sun.jna.Pointer res)
Frees the memory that was allocated for the dynamically allocated linked
list res.
|
String |
gai_strerror(int e)
Translates getaddrinfo error codes to a human readable string, suitable
for error reporting.
|
int |
getaddrinfo(String node,
String service,
CLibrary.Addrinfo hints,
com.sun.jna.ptr.PointerByReference res)
Given node and service, which identify an Internet host and a service,
getaddrinfo() returns one or more addrinfo structures, each of which
contains an Internet address that can be specified in a call to bind(2)
or connect(2).
|
int |
getloadavg(double[] loadavg,
int nelem)
The getloadavg() function returns the number of processes in the system
run queue averaged over various periods of time.
|
int |
getpagesize()
Returns the number of bytes in a memory page, where "page" is a
fixed-length block, the unit for memory allocation and file mapping
performed by mmap(2).
|
int |
getpid()
Returns the process ID of the calling process.
|
int |
readlink(String path,
com.sun.jna.Pointer buf,
int bufsize)
Places the contents of the symbolic link path in the buffer buf, which
has size bufsiz.
|
int |
sysctl(int[] name,
int namelen,
com.sun.jna.Pointer oldp,
com.sun.jna.ptr.IntByReference oldlenp,
com.sun.jna.Pointer newp,
int newlen)
The sysctl() function retrieves system information and allows processes
with appropriate privileges to set system information.
|
int |
sysctlbyname(String name,
com.sun.jna.Pointer oldp,
com.sun.jna.ptr.IntByReference oldlenp,
com.sun.jna.Pointer newp,
int newlen)
The sysctlbyname() function accepts an ASCII representation of the name
and internally looks up the integer name vector.
|
int |
sysctlnametomib(String name,
com.sun.jna.Pointer mibp,
com.sun.jna.ptr.IntByReference size)
The sysctlnametomib() function accepts an ASCII representation of the
name, looks up the integer name vector, and returns the numeric
representation in the mib array pointed to by mibp.
|
static final int AI_CANONNAME
int sysctl(int[] name,
int namelen,
com.sun.jna.Pointer oldp,
com.sun.jna.ptr.IntByReference oldlenp,
com.sun.jna.Pointer newp,
int newlen)
name - MIB array of integersnamelen - length of the MIB arrayoldp - Information retrievedoldlenp - Size of information retrievednewp - Information to be writtennewlen - Size of information to be writtenint sysctlbyname(String name, com.sun.jna.Pointer oldp, com.sun.jna.ptr.IntByReference oldlenp, com.sun.jna.Pointer newp, int newlen)
name - ASCII representation of the MIB nameoldp - Information retrievedoldlenp - Size of information retrievednewp - Information to be writtennewlen - Size of information to be writtenint sysctlnametomib(String name, com.sun.jna.Pointer mibp, com.sun.jna.ptr.IntByReference size)
name - ASCII representation of the namemibp - Integer array containing the corresponding name vector.size - On input, number of elements in the returned array; on output,
the number of entries copied.int getloadavg(double[] loadavg,
int nelem)
loadavg - An array of doubles which will be filled with the resultsnelem - Number of samples to returnint getpid()
int getaddrinfo(String node, String service, CLibrary.Addrinfo hints, com.sun.jna.ptr.PointerByReference res)
node - a numerical network address or a network hostname, whose
network addresses are looked up and resolved.service - sets the port in each returned address structure.hints - specifies criteria for selecting the socket address structures
returned in the list pointed to by res.res - returned address structurevoid freeaddrinfo(com.sun.jna.Pointer res)
res - Pointer to linked list returned by getaddrinfoString gai_strerror(int e)
e - Error code from getaddrinfoint readlink(String path, com.sun.jna.Pointer buf, int bufsize)
path - A symbolic linkbuf - Holds actual path to location pointed to by symlinkbufsize - size of data in bufferint getpagesize()
Copyright © 2010–2018 oshi. All rights reserved.