Class IOURing

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class IOURing extends Struct<IOURing> implements NativeResource

 struct io_uring {
     {@link IOURingSQ struct io_uring_sq} sq;
     {@link IOURingCQ struct io_uring_cq} cq;
     unsigned int flags;
     int ring_fd;
     unsigned int features;
     int enter_ring_fd;
     __u8 int_flags;
     __u8 pad[3];
     unsigned pad2;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int SQ
      The struct member offsets.
    • CQ

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

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

      public static final int RING_FD
      The struct member offsets.
    • FEATURES

      public static final int FEATURES
      The struct member offsets.
    • ENTER_RING_FD

      public static final int ENTER_RING_FD
      The struct member offsets.
    • INT_FLAGS

      public static final int INT_FLAGS
      The struct member offsets.
    • PAD

      public static final int PAD
      The struct member offsets.
    • PAD2

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

    • IOURing

      public IOURing(ByteBuffer container)
      Creates a IOURing 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()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<IOURing>
    • sq

      public IOURingSQ sq()
      Returns:
      a IOURingSQ view of the sq field.
    • cq

      public IOURingCQ cq()
      Returns:
      a IOURingCQ view of the cq field.
    • flags

      public int flags()
      Returns:
      the value of the flags field.
    • ring_fd

      public int ring_fd()
      Returns:
      the value of the ring_fd field.
    • features

      public int features()
      Returns:
      the value of the features field.
    • enter_ring_fd

      public int enter_ring_fd()
      Returns:
      the value of the enter_ring_fd field.
    • int_flags

      public byte int_flags()
      Returns:
      the value of the int_flags field.
    • sq

      public IOURing sq(IOURingSQ value)
      Copies the specified IOURingSQ to the sq field.
    • sq

      public IOURing sq(Consumer<IOURingSQ> consumer)
      Passes the sq field to the specified Consumer.
    • cq

      public IOURing cq(IOURingCQ value)
      Copies the specified IOURingCQ to the cq field.
    • cq

      public IOURing cq(Consumer<IOURingCQ> consumer)
      Passes the cq field to the specified Consumer.
    • flags

      public IOURing flags(int value)
      Sets the specified value to the flags field.
    • ring_fd

      public IOURing ring_fd(int value)
      Sets the specified value to the ring_fd field.
    • features

      public IOURing features(int value)
      Sets the specified value to the features field.
    • enter_ring_fd

      public IOURing enter_ring_fd(int value)
      Sets the specified value to the enter_ring_fd field.
    • int_flags

      public IOURing int_flags(byte value)
      Sets the specified value to the int_flags field.
    • set

      public IOURing set(IOURingSQ sq, IOURingCQ cq, int flags, int ring_fd, int features, int enter_ring_fd, byte int_flags)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static IOURing.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new IOURing.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
    • nsq

      public static IOURingSQ nsq(long struct)
      Unsafe version of sq().
    • ncq

      public static IOURingCQ ncq(long struct)
      Unsafe version of cq().
    • nflags

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

      public static int nring_fd(long struct)
      Unsafe version of ring_fd().
    • nfeatures

      public static int nfeatures(long struct)
      Unsafe version of features().
    • nenter_ring_fd

      public static int nenter_ring_fd(long struct)
      Unsafe version of enter_ring_fd().
    • nint_flags

      public static byte nint_flags(long struct)
      Unsafe version of int_flags().
    • npad

      public static ByteBuffer npad(long struct)
    • npad

      public static byte npad(long struct, int index)
    • npad2

      public static int npad2(long struct)
    • nsq

      public static void nsq(long struct, IOURingSQ value)
      Unsafe version of sq.
    • ncq

      public static void ncq(long struct, IOURingCQ value)
      Unsafe version of cq.
    • nflags

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

      public static void nring_fd(long struct, int value)
      Unsafe version of ring_fd.
    • nfeatures

      public static void nfeatures(long struct, int value)
      Unsafe version of features.
    • nenter_ring_fd

      public static void nenter_ring_fd(long struct, int value)
      Unsafe version of enter_ring_fd.
    • nint_flags

      public static void nint_flags(long struct, byte value)
      Unsafe version of int_flags.
    • npad

      public static void npad(long struct, ByteBuffer value)
    • npad

      public static void npad(long struct, int index, byte value)
    • npad2

      public static void npad2(long struct, int value)
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate