Package org.lwjgl.system.linux
Class Flock
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.linux.Flock
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class Flock extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct flock64 { shortl_type(); shortl_whence(); off_tl_start(); off_tl_len(); pid_tl_pid(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlock.BufferAn array ofFlockstructs.
-
Constructor Summary
Constructors Constructor Description Flock(java.nio.ByteBuffer container)Creates aFlockinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Flockcalloc()Returns a newFlockinstance allocated withmemCalloc.static Flock.Buffercalloc(int capacity)Returns a newFlock.Bufferinstance allocated withmemCalloc.static Flock.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newFlock.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Flockcalloc(org.lwjgl.system.MemoryStack stack)Returns a newFlockinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Flockcreate()Returns a newFlockinstance allocated withBufferUtils.static Flock.Buffercreate(int capacity)Returns a newFlock.Bufferinstance allocated withBufferUtils.static Flockcreate(long address)Returns a newFlockinstance for the specified memory address.static Flock.Buffercreate(long address, int capacity)Create aFlock.Bufferinstance at the specified memory.static FlockcreateSafe(long address)static Flock.BuffercreateSafe(long address, int capacity)longl_len()size of the locked area; zero means until EOFFlockl_len(long value)Sets the specified value to thel_len()field.intl_pid()process holding the lockFlockl_pid(int value)Sets the specified value to thel_pid()field.longl_start()offset where the lock beginsFlockl_start(long value)Sets the specified value to thel_start()field.shortl_type()type of lock.Flockl_type(short value)Sets the specified value to thel_type()field.shortl_whence()wherel_startis relative to (likelseek)Flockl_whence(short value)Sets the specified value to thel_whence()field.static Flockmalloc()Returns a newFlockinstance allocated withmemAlloc.static Flock.Buffermalloc(int capacity)Returns a newFlock.Bufferinstance allocated withmemAlloc.static Flock.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newFlock.Bufferinstance allocated on the specifiedMemoryStack.static Flockmalloc(org.lwjgl.system.MemoryStack stack)Returns a newFlockinstance allocated on the specifiedMemoryStack.static longnl_len(long struct)Unsafe version ofl_len().static voidnl_len(long struct, long value)Unsafe version ofl_len.static intnl_pid(long struct)Unsafe version ofl_pid().static voidnl_pid(long struct, int value)Unsafe version ofl_pid.static longnl_start(long struct)Unsafe version ofl_start().static voidnl_start(long struct, long value)Unsafe version ofl_start.static shortnl_type(long struct)Unsafe version ofl_type().static voidnl_type(long struct, short value)Unsafe version ofl_type.static shortnl_whence(long struct)Unsafe version ofl_whence().static voidnl_whence(long struct, short value)Unsafe version ofl_whence.Flockset(short l_type, short l_whence, long l_start, long l_len, int l_pid)Initializes this struct with the specified values.Flockset(Flock src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
Flock
public Flock(java.nio.ByteBuffer container)
Creates aFlockinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
l_type
public short l_type()
type of lock. One of:FCNTL.F_RDLCKFCNTL.F_WRLCKFCNTL.F_UNLCK
-
l_whence
public short l_whence()
wherel_startis relative to (likelseek)
-
l_start
public long l_start()
offset where the lock begins
-
l_len
public long l_len()
size of the locked area; zero means until EOF
-
l_pid
public int l_pid()
process holding the lock
-
l_whence
public Flock l_whence(short value)
Sets the specified value to thel_whence()field.
-
set
public Flock set(short l_type, short l_whence, long l_start, long l_len, int l_pid)
Initializes this struct with the specified values.
-
set
public Flock set(Flock src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static Flock malloc()
Returns a newFlockinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static Flock calloc()
Returns a newFlockinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static Flock create()
Returns a newFlockinstance allocated withBufferUtils.
-
create
public static Flock create(long address)
Returns a newFlockinstance for the specified memory address.
-
createSafe
@Nullable public static Flock createSafe(long address)
-
malloc
public static Flock.Buffer malloc(int capacity)
Returns a newFlock.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static Flock.Buffer calloc(int capacity)
Returns a newFlock.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static Flock.Buffer create(int capacity)
Returns a newFlock.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static Flock.Buffer create(long address, int capacity)
Create aFlock.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static Flock.Buffer createSafe(long address, int capacity)
-
malloc
public static Flock malloc(org.lwjgl.system.MemoryStack stack)
Returns a newFlockinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static Flock calloc(org.lwjgl.system.MemoryStack stack)
Returns a newFlockinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static Flock.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newFlock.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static Flock.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newFlock.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nl_type
public static short nl_type(long struct)
Unsafe version ofl_type().
-
nl_whence
public static short nl_whence(long struct)
Unsafe version ofl_whence().
-
nl_start
public static long nl_start(long struct)
Unsafe version ofl_start().
-
nl_len
public static long nl_len(long struct)
Unsafe version ofl_len().
-
nl_pid
public static int nl_pid(long struct)
Unsafe version ofl_pid().
-
nl_type
public static void nl_type(long struct, short value)Unsafe version ofl_type.
-
nl_whence
public static void nl_whence(long struct, short value)Unsafe version ofl_whence.
-
nl_start
public static void nl_start(long struct, long value)Unsafe version ofl_start.
-
nl_len
public static void nl_len(long struct, long value)Unsafe version ofl_len.
-
nl_pid
public static void nl_pid(long struct, int value)Unsafe version ofl_pid.
-
-