Class IOURingCQE

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<IOURingCQE>
org.lwjgl.system.linux.liburing.IOURingCQE
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class IOURingCQE extends org.lwjgl.system.Struct<IOURingCQE> implements org.lwjgl.system.NativeResource
IO completion data structure (Completion Queue Entry).

Layout


 struct io_uring_cqe {
     __u64 user_data();
     __s32 res();
     __u32 flags();
     __u64 big_cqe()[0];
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of IOURingCQE structs.

    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

    Fields
    Modifier and Type
    Field
    Description
    static 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 size in bytes.
    static final int
    The struct member offsets.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a IOURingCQE instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    If the ring is initialized with SETUP_CQE32, then this field contains 16-bytes of padding, doubling the size of the CQE.
    long
    big_cqe(int index)
    If the ring is initialized with SETUP_CQE32, then this field contains 16-bytes of padding, doubling the size of the CQE.
    big_cqe(int index, long value)
    Sets the specified value at the specified index of the big_cqe() field.
    Copies the specified LongBuffer to the big_cqe() field.
    static IOURingCQE
    Returns a new IOURingCQE instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new IOURingCQE.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new IOURingCQE.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static IOURingCQE
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new IOURingCQE instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static IOURingCQE
    Returns a new IOURingCQE instance allocated with BufferUtils.
    create(int capacity)
    Returns a new IOURingCQE.Buffer instance allocated with BufferUtils.
    static IOURingCQE
    create(long address)
    Returns a new IOURingCQE instance for the specified memory address.
    create(long address, int capacity)
    Create a IOURingCQE.Buffer instance at the specified memory.
    static IOURingCQE
    createSafe(long address)
    Like create, but returns null if address is NULL.
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    int
    is used for certain commands, like OP_POLL_ADD or in conjunction with LibIOURing.IOSQE_BUFFER_SELECT, see those entries
    flags(int value)
    Sets the specified value to the flags() field.
    static IOURingCQE
    Returns a new IOURingCQE instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new IOURingCQE.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new IOURingCQE.Buffer instance allocated on the specified MemoryStack.
    static IOURingCQE
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new IOURingCQE instance allocated on the specified MemoryStack.
    static LongBuffer
    nbig_cqe(long struct)
    Unsafe version of big_cqe().
    static long
    nbig_cqe(long struct, int index)
    Unsafe version of big_cqe.
    static void
    nbig_cqe(long struct, int index, long value)
    Unsafe version of big_cqe.
    static void
    nbig_cqe(long struct, LongBuffer value)
    Unsafe version of big_cqe.
    static int
    nflags(long struct)
    Unsafe version of flags().
    static void
    nflags(long struct, int value)
    Unsafe version of flags.
    static int
    nres(long struct)
    Unsafe version of res().
    static void
    nres(long struct, int value)
    Unsafe version of res.
    static long
    nuser_data(long struct)
    Unsafe version of user_data().
    static void
    nuser_data(long struct, long value)
    Unsafe version of user_data.
    int
    res()
    is the operation-specific result, but io_uring-specific errors (e.g.
    res(int value)
    Sets the specified value to the res() field.
    set(long user_data, int res, int flags, LongBuffer big_cqe)
    Initializes this struct with the specified values.
    Copies the specified struct data to this struct.
    int
     
    long
    is copied from the field of the same name in the submission queue entry.
    user_data(long value)
    Sets the specified value to the user_data() field.

    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 class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • USER_DATA

      public static final int USER_DATA
      The struct member offsets.
    • RES

      public static final int RES
      The struct member offsets.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
    • BIG_CQE

      public static final int BIG_CQE
      The struct member offsets.
  • Constructor Details

    • IOURingCQE

      public IOURingCQE(ByteBuffer container)
      Creates a IOURingCQE instance at the current position of the specified ByteBuffer 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 class org.lwjgl.system.Struct<IOURingCQE>
    • user_data

      public long user_data()
      is copied from the field of the same name in the submission queue entry.

      The primary use case is to store data that the application will need to access upon completion of this particular I/O.

    • res

      public int res()
      is the operation-specific result, but io_uring-specific errors (e.g. flags or opcode invalid) are returned through this field.

      For read and write opcodes, the return values match errno values documented in the preadv2(2) and pwritev2(2) man pages, with res holding the equivalent of -errno for error cases, or the transferred number of bytes in case the operation is successful. Hence both error and success return can be found in that field in the CQE. For other request types, the return values are documented in the matching man page for that type, or in the opcodes section for io_uring-specific opcodes.

    • flags

      public int flags()
      is used for certain commands, like OP_POLL_ADD or in conjunction with LibIOURing.IOSQE_BUFFER_SELECT, see those entries
    • big_cqe

      public LongBuffer big_cqe()
      If the ring is initialized with SETUP_CQE32, then this field contains 16-bytes of padding, doubling the size of the CQE.
    • big_cqe

      public long big_cqe(int index)
      If the ring is initialized with SETUP_CQE32, then this field contains 16-bytes of padding, doubling the size of the CQE.
    • user_data

      public IOURingCQE user_data(long value)
      Sets the specified value to the user_data() field.
    • res

      public IOURingCQE res(int value)
      Sets the specified value to the res() field.
    • flags

      public IOURingCQE flags(int value)
      Sets the specified value to the flags() field.
    • big_cqe

      public IOURingCQE big_cqe(LongBuffer value)
      Copies the specified LongBuffer to the big_cqe() field.
    • big_cqe

      public IOURingCQE big_cqe(int index, long value)
      Sets the specified value at the specified index of the big_cqe() field.
    • set

      public IOURingCQE set(long user_data, int res, int flags, LongBuffer big_cqe)
      Initializes this struct with the specified values.
    • set

      public IOURingCQE set(IOURingCQE src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static IOURingCQE malloc()
      Returns a new IOURingCQE instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static IOURingCQE calloc()
      Returns a new IOURingCQE instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static IOURingCQE create()
      Returns a new IOURingCQE instance allocated with BufferUtils.
    • create

      public static IOURingCQE create(long address)
      Returns a new IOURingCQE instance for the specified memory address.
    • createSafe

      @Nullable public static IOURingCQE createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static IOURingCQE.Buffer malloc(int capacity)
      Returns a new IOURingCQE.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static IOURingCQE.Buffer calloc(int capacity)
      Returns a new IOURingCQE.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static IOURingCQE.Buffer create(int capacity)
      Returns a new IOURingCQE.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static IOURingCQE.Buffer create(long address, int capacity)
      Create a IOURingCQE.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      @Nullable public static IOURingCQE.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static IOURingCQE malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new IOURingCQE instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static IOURingCQE calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new IOURingCQE instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static IOURingCQE.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new IOURingCQE.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static IOURingCQE.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new IOURingCQE.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nuser_data

      public static long nuser_data(long struct)
      Unsafe version of user_data().
    • nres

      public static int nres(long struct)
      Unsafe version of res().
    • nflags

      public static int nflags(long struct)
      Unsafe version of flags().
    • nbig_cqe

      public static LongBuffer nbig_cqe(long struct)
      Unsafe version of big_cqe().
    • nbig_cqe

      public static long nbig_cqe(long struct, int index)
      Unsafe version of big_cqe.
    • nuser_data

      public static void nuser_data(long struct, long value)
      Unsafe version of user_data.
    • nres

      public static void nres(long struct, int value)
      Unsafe version of res.
    • nflags

      public static void nflags(long struct, int value)
      Unsafe version of flags.
    • nbig_cqe

      public static void nbig_cqe(long struct, LongBuffer value)
      Unsafe version of big_cqe.
    • nbig_cqe

      public static void nbig_cqe(long struct, int index, long value)
      Unsafe version of big_cqe.