Interface LinuxLibc
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classPart of utmpx structurestatic classReturn type for getutxent()static classstatic class32-bit timeval required for utmpx structureNested classes/interfaces inherited from interface CLibrary
CLibrary.Addrinfo, CLibrary.BsdIp6stat, CLibrary.BsdIpstat, CLibrary.BsdTcpstat, CLibrary.BsdUdpstat, CLibrary.SockaddrModifier and TypeInterfaceDescriptionstatic classstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from interface LibC
LibC.Statvfs, LibC.SysinfoNested classes/interfaces inherited from interface LibCAPI
LibCAPI.size_t, LibCAPI.ssize_tNested classes/interfaces inherited from interface Library
Library.HandlerNested classes/interfaces inherited from interface Resource
Resource.Rlimit -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LinuxLibcstatic final NativeLongSYS_gettid Defined in one of: arch/arm64/include/asm/unistd32.h, 224 arch/x86/include/uapi/asm/unistd_32.h, 224 arch/x86/include/uapi/asm/unistd_64.h, 186 include/uapi/asm-generic/unistd.h, 178Fields inherited from interface CLibrary
AI_CANONNAME, LOGIN_PROCESS, RUSAGE_SELF, USER_PROCESS, UT_HOSTSIZE, UT_LINESIZE, UT_NAMESIZEModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface LibCAPI
HOST_NAME_MAXFields inherited from interface 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_SYMBOL_PROVIDER, OPTION_TYPE_MAPPERFields inherited from interface Reboot
RB_AUTOBOOT, RB_DISABLE_CAD, RB_ENABLE_CAD, RB_HALT_SYSTEM, RB_KEXEC, RB_POWER_OFF, RB_SW_SUSPENDFields inherited from interface 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 -
Method Summary
Modifier and TypeMethodDescriptionintgetrusage(int who, LinuxLibc.Rusage rusage) intgettid()Returns the caller's thread ID (TID).Reads a line from the current file position in the utmp file.syscall(NativeLong number, Object... args) syscall() performs the system call whose assembly language interface has the specified number with the specified arguments.Methods inherited from interface CLibrary
endutxent, freeaddrinfo, gai_strerror, getaddrinfo, getpid, open, pread, setutxent, sysctl, sysctlbyname, sysctlnametomibModifier and TypeMethodDescriptionvoidCloses the utmp file.voidfreeaddrinfo(Pointer res) Frees the memory that was allocated for the dynamically allocated linked list res.gai_strerror(int e) Translates getaddrinfo error codes to a human readable string, suitable for error reporting.intgetaddrinfo(String node, String service, CLibrary.Addrinfo hints, 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).intgetpid()Returns the process ID of the calling process.intpread(int fildes, Pointer buf, LibCAPI.size_t nbyte, NativeLong offset) voidRewinds the file pointer to the beginning of the utmp file.intsysctl(int[] name, int namelen, Pointer oldp, LibCAPI.size_t.ByReference oldlenp, Pointer newp, LibCAPI.size_t newlen) The sysctl() function retrieves system information and allows processes with appropriate privileges to set system information.intsysctlbyname(String name, Pointer oldp, LibCAPI.size_t.ByReference oldlenp, Pointer newp, LibCAPI.size_t newlen) The sysctlbyname() function accepts an ASCII representation of the name and internally looks up the integer name vector.intsysctlnametomib(String name, Pointer mibp, LibCAPI.size_t.ByReference 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 LibCAPI
close, getdomainname, getegid, getenv, geteuid, getgid, gethostname, getloadavg, getuid, msync, munmap, setdomainname, setegid, setenv, seteuid, setgid, sethostname, setuid, unsetenv
-
Field Details
-
INSTANCE
-
SYS_GETTID
SYS_gettid Defined in one of: arch/arm64/include/asm/unistd32.h, 224 arch/x86/include/uapi/asm/unistd_32.h, 224 arch/x86/include/uapi/asm/unistd_64.h, 186 include/uapi/asm-generic/unistd.h, 178
-
-
Method Details
-
getutxent
LinuxLibc.LinuxUtmpx 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
LinuxLibc.LinuxUtmpxon success, and NULL on failure (which includes the "record not found" case)
-
gettid
int gettid()Returns the caller's thread ID (TID). In a single-threaded process, the thread ID is equal to the process ID. In a multithreaded process, all threads have the same PID, but each one has a unique TID.- Returns:
- the thread ID of the calling thread.
-
syscall
syscall() performs the system call whose assembly language interface has the specified number with the specified arguments.- Parameters:
number- sys call numberargs- sys call arguments- Returns:
- The return value is defined by the system call being invoked. In general, a 0 return value indicates success. A -1 return value indicates an error, and an error code is stored in errno.
-
getrusage
-