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:
AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class Flock
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
Layout
struct flock64 {
short l_type()
;
short l_whence()
;
off_t l_start()
;
off_t l_len()
;
pid_t l_pid()
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionFlock
(ByteBuffer container) Creates aFlock
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic Flock
calloc()
Returns a newFlock
instance allocated withmemCalloc
.static Flock.Buffer
calloc
(int capacity) Returns a newFlock.Buffer
instance allocated withmemCalloc
.static Flock.Buffer
calloc
(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newFlock.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Flock
calloc
(org.lwjgl.system.MemoryStack stack) Returns a newFlock
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Flock
create()
Returns a newFlock
instance allocated withBufferUtils
.static Flock.Buffer
create
(int capacity) Returns a newFlock.Buffer
instance allocated withBufferUtils
.static Flock
create
(long address) Returns a newFlock
instance for the specified memory address.static Flock.Buffer
create
(long address, int capacity) Create aFlock.Buffer
instance at the specified memory.static Flock
createSafe
(long address) static Flock.Buffer
createSafe
(long address, int capacity) long
l_len()
size of the locked area; zero means until EOFl_len
(long value) Sets the specified value to thel_len()
field.int
l_pid()
process holding the lockl_pid
(int value) Sets the specified value to thel_pid()
field.long
l_start()
offset where the lock beginsl_start
(long value) Sets the specified value to thel_start()
field.short
l_type()
type of lock.l_type
(short value) Sets the specified value to thel_type()
field.short
l_whence()
wherel_start
is relative to (likelseek
)l_whence
(short value) Sets the specified value to thel_whence()
field.static Flock
malloc()
Returns a newFlock
instance allocated withmemAlloc
.static Flock.Buffer
malloc
(int capacity) Returns a newFlock.Buffer
instance allocated withmemAlloc
.static Flock.Buffer
malloc
(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newFlock.Buffer
instance allocated on the specifiedMemoryStack
.static Flock
malloc
(org.lwjgl.system.MemoryStack stack) Returns a newFlock
instance allocated on the specifiedMemoryStack
.static long
nl_len
(long struct) Unsafe version ofl_len()
.static void
nl_len
(long struct, long value) Unsafe version ofl_len
.static int
nl_pid
(long struct) Unsafe version ofl_pid()
.static void
nl_pid
(long struct, int value) Unsafe version ofl_pid
.static long
nl_start
(long struct) Unsafe version ofl_start()
.static void
nl_start
(long struct, long value) Unsafe version ofl_start
.static short
nl_type
(long struct) Unsafe version ofl_type()
.static void
nl_type
(long struct, short value) Unsafe version ofl_type
.static short
nl_whence
(long struct) Unsafe version ofl_whence()
.static void
nl_whence
(long struct, short value) Unsafe version ofl_whence
.set
(short l_type, short l_whence, long l_start, long l_len, int l_pid) Initializes this struct with the specified values.Copies the specified struct data to this struct.int
sizeof()
Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
L_TYPE
public static final int L_TYPEThe struct member offsets. -
L_WHENCE
public static final int L_WHENCEThe struct member offsets. -
L_START
public static final int L_STARTThe struct member offsets. -
L_LEN
public static final int L_LENThe struct member offsets. -
L_PID
public static final int L_PIDThe struct member offsets.
-
-
Constructor Details
-
Flock
Creates aFlock
instance at the current position of the specifiedByteBuffer
container. 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
l_type
public short l_type()type of lock. One of:FCNTL.F_RDLCK
FCNTL.F_WRLCK
FCNTL.F_UNLCK
-
l_whence
public short l_whence()wherel_start
is 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_type
Sets the specified value to thel_type()
field. -
l_whence
Sets the specified value to thel_whence()
field. -
l_start
Sets the specified value to thel_start()
field. -
l_len
Sets the specified value to thel_len()
field. -
l_pid
Sets the specified value to thel_pid()
field. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newFlock
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newFlock
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newFlock
instance allocated withBufferUtils
. -
create
Returns a newFlock
instance for the specified memory address. -
createSafe
-
malloc
Returns a newFlock.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newFlock.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newFlock.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aFlock.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newFlock
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newFlock
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newFlock.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newFlock.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
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
.
-