APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.security.auth.module

public Class UnixSystem

extends Object
Class Inheritance
Annotations
@SuppressWarnings:restricted
Imports
jdk.internal.util.Architecture, .OperatingSystem, java.lang.foreign.AddressLayout, .Arena, .FunctionDescriptor, .GroupLayout, .Linker, .MemoryLayout, .MemorySegment, .StructLayout, .SymbolLookup, .ValueLayout, java.lang.invoke.MethodHandle, .VarHandle

This class implementation retrieves and makes available Unix UID/GID/groups information for the current user.
Since
1.4

Field Summary

Modifier and TypeField and Description
private static final ValueLayout.OfByte
private static final ValueLayout.OfInt
private static final ValueLayout.OfLong
private static final AddressLayout
private static final ValueLayout
private static final boolean
private static final StructLayout
private static final int
protected long
gid

The current group ID.

protected long[]
groups

The current list of groups.

private static final Linker
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final MethodHandle
private static final GroupLayout
private static final SymbolLookup
protected long
uid

The current user ID.

protected String
username

The current username.

private static final VarHandle
private static final VarHandle
private static final VarHandle
private static final VarHandle

Constructor Summary

AccessConstructor and Description
public
UnixSystem()

Instantiate a UnixSystem and load the native library to access the underlying system information.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the GID for the current Unix user.
getGid
()

Get the GID for the current Unix user.

public long[]

Returns:

the supplementary groups for the current Unix user.
getGroups
()

Get the supplementary groups for the current Unix user.

public long

Returns:

the UID for the current Unix user.
getUid
()

Get the UID for the current Unix user.

public String

Returns:

the username for the current Unix user.
getUsername
()

Get the username for the current Unix user.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

C_CHARback to summary
private static final ValueLayout.OfByte C_CHAR
C_INTback to summary
private static final ValueLayout.OfInt C_INT
C_LONGback to summary
private static final ValueLayout.OfLong C_LONG
C_POINTERback to summary
private static final AddressLayout C_POINTER
C_SIZE_Tback to summary
private static final ValueLayout C_SIZE_T
calling_convention_requires_int_as_longback to summary
private static final boolean calling_convention_requires_int_as_long
CAPTURE_STATE_LAYOUTback to summary
private static final StructLayout CAPTURE_STATE_LAYOUT
GETPW_R_SIZE_MAXback to summary
private static final int GETPW_R_SIZE_MAX
gidback to summary
protected long gid

The current group ID.

groupsback to summary
protected long[] groups

The current list of groups.

LINKERback to summary
private static final Linker LINKER
MH_getgroupsback to summary
private static final MethodHandle MH_getgroups
MH_getpwuid_rback to summary
private static final MethodHandle MH_getpwuid_r
MH_getuidback to summary
private static final MethodHandle MH_getuid
MH_strerrorback to summary
private static final MethodHandle MH_strerror
ML_passwdback to summary
private static final GroupLayout ML_passwd
SYMBOL_LOOKUPback to summary
private static final SymbolLookup SYMBOL_LOOKUP
uidback to summary
protected long uid

The current user ID.

usernameback to summary
protected String username

The current username.

VH_errnoback to summary
private static final VarHandle VH_errno
VH_pw_gidback to summary
private static final VarHandle VH_pw_gid
VH_pw_nameback to summary
private static final VarHandle VH_pw_name
VH_pw_uidback to summary
private static final VarHandle VH_pw_uid

Constructor Detail

UnixSystemback to summary
public UnixSystem()

Instantiate a UnixSystem and load the native library to access the underlying system information.

Method Detail

getGidback to summary
public long getGid()

Get the GID for the current Unix user.

Returns:long

the GID for the current Unix user.

getGroupsback to summary
public long[] getGroups()

Get the supplementary groups for the current Unix user.

Returns:long[]

the supplementary groups for the current Unix user.

getUidback to summary
public long getUid()

Get the UID for the current Unix user.

Returns:long

the UID for the current Unix user.

getUsernameback to summary
public String getUsername()

Get the username for the current Unix user.

Returns:String

the username for the current Unix user.