Package oshi.jna.platform.mac
Interface SystemB
- All Superinterfaces:
CLibrary
,com.sun.jna.platform.unix.LibCAPI
,com.sun.jna.Library
,com.sun.jna.platform.unix.Reboot
,com.sun.jna.platform.unix.Resource
,com.sun.jna.platform.mac.SystemB
System class. This class should be considered non-API as it may be removed
if/when its code is incorporated into the JNA project.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Mac internet socket infostatic class
Mac connection infostatic class
Union for TCP or internet socket infostatic class
Mac file descriptor infostatic class
Mac file infostatic class
Mac socket infostatic class
Mack IP Socket Infostatic class
Mac TCP socket infoNested classes/interfaces inherited from interface oshi.jna.platform.unix.CLibrary
CLibrary.Addrinfo, CLibrary.BsdIp6stat, CLibrary.BsdIpstat, CLibrary.BsdTcpstat, CLibrary.BsdUdpstat, CLibrary.Sockaddr
Nested classes/interfaces inherited from interface com.sun.jna.platform.unix.LibCAPI
com.sun.jna.platform.unix.LibCAPI.size_t, com.sun.jna.platform.unix.LibCAPI.ssize_t
Nested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler
Nested classes/interfaces inherited from interface com.sun.jna.platform.unix.Resource
com.sun.jna.platform.unix.Resource.Rlimit
Nested classes/interfaces inherited from interface com.sun.jna.platform.mac.SystemB
com.sun.jna.platform.mac.SystemB.Group, com.sun.jna.platform.mac.SystemB.HostCpuLoadInfo, com.sun.jna.platform.mac.SystemB.HostLoadInfo, com.sun.jna.platform.mac.SystemB.IFdata, com.sun.jna.platform.mac.SystemB.IFdata64, com.sun.jna.platform.mac.SystemB.IFmsgHdr, com.sun.jna.platform.mac.SystemB.IFmsgHdr2, com.sun.jna.platform.mac.SystemB.Passwd, com.sun.jna.platform.mac.SystemB.ProcBsdInfo, com.sun.jna.platform.mac.SystemB.ProcTaskAllInfo, com.sun.jna.platform.mac.SystemB.ProcTaskInfo, com.sun.jna.platform.mac.SystemB.RUsageInfoV2, com.sun.jna.platform.mac.SystemB.Statfs, com.sun.jna.platform.mac.SystemB.Timeval, com.sun.jna.platform.mac.SystemB.Timezone, com.sun.jna.platform.mac.SystemB.VMMeter, com.sun.jna.platform.mac.SystemB.VMStatistics, com.sun.jna.platform.mac.SystemB.VMStatistics64, com.sun.jna.platform.mac.SystemB.VnodeInfoPath, com.sun.jna.platform.mac.SystemB.VnodePathInfo, com.sun.jna.platform.mac.SystemB.XswUsage
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static int
static SystemB
static int
static int
static int
static int
static int
static int
static int
static int
static int
static int
Fields inherited from interface oshi.jna.platform.unix.CLibrary
AI_CANONNAME, LOGIN_PROCESS, USER_PROCESS, UT_HOSTSIZE, UT_LINESIZE, UT_NAMESIZE
Fields inherited from interface com.sun.jna.platform.unix.LibCAPI
HOST_NAME_MAX
Fields inherited from interface com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Fields inherited from interface com.sun.jna.platform.unix.Reboot
RB_AUTOBOOT, RB_DISABLE_CAD, RB_ENABLE_CAD, RB_HALT_SYSTEM, RB_KEXEC, RB_POWER_OFF, RB_SW_SUSPEND
Fields inherited from interface com.sun.jna.platform.unix.Resource
RLIMIT_AS, RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_LOCKS, RLIMIT_MEMLOCK, RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_NLIMITS, RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_RTPRIO, RLIMIT_RTTIME, RLIMIT_SIGPENDING, RLIMIT_STACK
Fields inherited from interface com.sun.jna.platform.mac.SystemB
CPU_STATE_IDLE, CPU_STATE_MAX, CPU_STATE_NICE, CPU_STATE_SYSTEM, CPU_STATE_USER, HOST_CPU_LOAD_INFO, HOST_LOAD_INFO, HOST_VM_INFO, HOST_VM_INFO64, INT_SIZE, MAXCOMLEN, MAXPATHLEN, MFSTYPENAMELEN, MNAMELEN, MNT_DWAIT, MNT_NOWAIT, MNT_WAIT, PROC_ALL_PIDS, PROC_PIDPATHINFO_MAXSIZE, PROC_PIDTASKALLINFO, PROC_PIDTASKINFO, PROC_PIDTBSDINFO, PROC_PIDVNODEPATHINFO, PROCESSOR_BASIC_INFO, PROCESSOR_CPU_LOAD_INFO, RUSAGE_INFO_V2, UINT64_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionReads a line from the current file position in the utmp file.int
proc_pidfdinfo(int pid, int fd, int flavor, com.sun.jna.Structure buffer, int buffersize)
int
sysctl(int[] name, int namelen, com.sun.jna.Pointer oldp, NativeSizeTByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.platform.unix.LibCAPI.size_t 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, NativeSizeTByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.platform.unix.LibCAPI.size_t 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, NativeSizeTByReference sizep)
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.Methods inherited from interface oshi.jna.platform.unix.CLibrary
endutxent, freeaddrinfo, gai_strerror, getaddrinfo, getpid, open, pread, setutxent
Methods inherited from interface com.sun.jna.platform.unix.LibCAPI
close, getdomainname, getegid, getenv, geteuid, getgid, gethostname, getloadavg, getuid, msync, munmap, setdomainname, setegid, setenv, seteuid, setgid, sethostname, setuid, unsetenv
Methods inherited from interface com.sun.jna.platform.unix.Reboot
reboot
Methods inherited from interface com.sun.jna.platform.unix.Resource
getrlimit, setrlimit
Methods inherited from interface com.sun.jna.platform.mac.SystemB
getfsstat64, getgrgid, getpid, getpwuid, gettimeofday, host_page_size, host_processor_info, host_statistics, host_statistics64, mach_host_self, mach_port_deallocate, mach_task_self, proc_listpids, proc_pid_rusage, proc_pidinfo, proc_pidpath, sysctl, sysctlbyname, sysctlnametomib
-
Field Details
-
INSTANCE
-
PROC_PIDLISTFDS
static final int PROC_PIDLISTFDS- See Also:
- Constant Field Values
-
PROX_FDTYPE_SOCKET
static final int PROX_FDTYPE_SOCKET- See Also:
- Constant Field Values
-
PROC_PIDFDSOCKETINFO
static final int PROC_PIDFDSOCKETINFO- See Also:
- Constant Field Values
-
TSI_T_NTIMERS
static final int TSI_T_NTIMERS- See Also:
- Constant Field Values
-
SOCKINFO_IN
static final int SOCKINFO_IN- See Also:
- Constant Field Values
-
SOCKINFO_TCP
static final int SOCKINFO_TCP- See Also:
- Constant Field Values
-
UTX_USERSIZE
static final int UTX_USERSIZE- See Also:
- Constant Field Values
-
UTX_LINESIZE
static final int UTX_LINESIZE- See Also:
- Constant Field Values
-
UTX_IDSIZE
static final int UTX_IDSIZE- See Also:
- Constant Field Values
-
UTX_HOSTSIZE
static final int UTX_HOSTSIZE- See Also:
- Constant Field Values
-
AF_INET
static final int AF_INET- See Also:
- Constant Field Values
-
AF_INET6
static final int AF_INET6- See Also:
- Constant Field Values
-
-
Method Details
-
getutxent
SystemB.MacUtmpx getutxent()Reads a line from the current file position in the utmp file. It returns a pointer to a structure containing the fields of the line.Not thread safe
- Returns:
- a
SystemB.MacUtmpx
on success, and NULL on failure (which includes the "record not found" case)
-
proc_pidfdinfo
int proc_pidfdinfo(int pid, int fd, int flavor, com.sun.jna.Structure buffer, int buffersize) -
sysctl
int sysctl(int[] name, int namelen, com.sun.jna.Pointer oldp, NativeSizeTByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.platform.unix.LibCAPI.size_t newlen)Description copied from interface:CLibrary
The sysctl() function retrieves system information and allows processes with appropriate privileges to set system information. The information available from sysctl() consists of integers, strings, and tables. The state is described using a "Management Information Base" (MIB) style name, listed in name, which is a namelen length array of integers. The information is copied into the buffer specified by oldp. The size of the buffer is given by the location specified by oldlenp before the call, and that location gives the amount of data copied after a successful call and after a call that returns with the error code ENOMEM. If the amount of data available is greater than the size of the buffer supplied, the call supplies as much data as fits in the buffer provided and returns with the error code ENOMEM. If the old value is not desired, oldp and oldlenp should be set to NULL. The size of the available data can be determined by calling sysctl() with the NULL argument for oldp. The size of the available data will be returned in the location pointed to by oldlenp. For some operations, the amount of space may change often. For these operations, the system attempts to round up so that the returned size is large enough for a call to return the data shortly thereafter. To set a new value, newp is set to point to a buffer of length newlen from which the requested value is to be taken. If a new value is not to be set, newp should be set to NULL and newlen set to 0.- Specified by:
sysctl
in interfaceCLibrary
- Parameters:
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 written- Returns:
- 0 on success; sets errno on failure
-
sysctlbyname
int sysctlbyname(String name, com.sun.jna.Pointer oldp, NativeSizeTByReference oldlenp, com.sun.jna.Pointer newp, com.sun.jna.platform.unix.LibCAPI.size_t newlen)Description copied from interface:CLibrary
The sysctlbyname() function accepts an ASCII representation of the name and internally looks up the integer name vector. Apart from that, it behaves the same as the standard sysctl() function.- Specified by:
sysctlbyname
in interfaceCLibrary
- Parameters:
name
- ASCII representation of the MIB nameoldp
- Information retrievedoldlenp
- Size of information retrievednewp
- Information to be writtennewlen
- Size of information to be written- Returns:
- 0 on success; sets errno on failure
-
sysctlnametomib
Description copied from interface:CLibrary
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. The number of elements in the mib array is given by the location specified by sizep before the call, and that location gives the number of entries copied after a successful call. The resulting mib and size may be used in subsequent sysctl() calls to get the data associated with the requested ASCII name. This interface is intended for use by applications that want to repeatedly request the same variable (the sysctl() function runs in about a third the time as the same request made via the sysctlbyname() function). The number of elements in the mib array can be determined by calling sysctlnametomib() with the NULL argument for mibp. The sysctlnametomib() function is also useful for fetching mib prefixes. If size on input is greater than the number of elements written, the array still contains the additional elements which may be written programmatically.- Specified by:
sysctlnametomib
in interfaceCLibrary
- Parameters:
name
- ASCII representation of the namemibp
- Integer array containing the corresponding name vector.sizep
- On input, number of elements in the returned array; on output, the number of entries copied.- Returns:
- 0 on success; sets errno on failure
-