Class LibURing
- java.lang.Object
-
- org.lwjgl.system.linux.liburing.LibURing
-
public class LibURing extends java.lang.ObjectNative bindings to liburing.
-
-
Field Summary
Fields Modifier and Type Field Description static longLIBURING_UDATA_TIMEOUT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int__io_uring_sqring_wait(IOURing ring)static booleanio_uring_cq_eventfd_enabled(IOURing ring)Returns true if theeventfdnotification is currently enabled.static intio_uring_cq_eventfd_toggle(IOURing ring, boolean enabled)Toggleeventfdnotification on or off, if aneventfdis registered with the ring.static intio_uring_cq_ready(IOURing ring)Retuns the number of unconsumed entries that are ready belonging to theringparam.static longio_uring_cqe_get_data(IOURingCQE cqe)Returns theuser_datawith the completion queue entrycqe.static longio_uring_cqe_get_data64(IOURingCQE cqe)Seesqe_set_data64.static voidio_uring_cqe_seen(IOURing ring, IOURingCQE cqe)Marks the IO completioncqebelonging to theringparam as processed.static intio_uring_enable_rings(IOURing ring)static voidio_uring_free_probe(IOURingProbe probe)Frees theprobeinstance allocated with theget_probefunction.static IOURingProbeio_uring_get_probe()Returns an allocatedio_uring_probestructure to the caller.static IOURingProbeio_uring_get_probe_ring(IOURing ring)Return an allocatedio_uring_probestructure, orNULLif probe fails (for example, if it is not available).static IOURingSQEio_uring_get_sqe(IOURing ring)Gets the next available submission queue entry from the submission queue belonging to theringparam.static intio_uring_mlock_size(int entries, int flags)Return requiredulimit -lmemory space for a given ring setup.static intio_uring_mlock_size_params(int entries, IOURingParams p)Returns the requiredulimit -l memlockmemory required for a given ring setup, in bytes.static intio_uring_opcode_supported(IOURingProbe p, int op)Allows the caller to determine if the passed inopcodebelonging to theprobeparam is supported.static intio_uring_peek_batch_cqe(IOURing ring, org.lwjgl.PointerBuffer cqes)Fill in an array of IO completions up to count, if any are available.static intio_uring_peek_cqe(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)Returns an IO completion, if one is readily available.static voidio_uring_prep_accept(IOURingSQE sqe, int fd, Sockaddr addr, int[] addrlen, int flags)Array version of:prep_acceptstatic voidio_uring_prep_accept(IOURingSQE sqe, int fd, Sockaddr addr, java.nio.IntBuffer addrlen, int flags)static voidio_uring_prep_accept_direct(IOURingSQE sqe, int fd, Sockaddr addr, int[] addrlen, int flags, int file_index)Array version of:prep_accept_directstatic voidio_uring_prep_accept_direct(IOURingSQE sqe, int fd, Sockaddr addr, java.nio.IntBuffer addrlen, int flags, int file_index)static voidio_uring_prep_cancel(IOURingSQE sqe, long user_data, int flags)static voidio_uring_prep_close(IOURingSQE sqe, int fd)static voidio_uring_prep_close_direct(IOURingSQE sqe, int file_index)static voidio_uring_prep_connect(IOURingSQE sqe, int fd, Sockaddr addr, int addrlen)static voidio_uring_prep_epoll_ctl(IOURingSQE sqe, int epfd, int fd, int op, EpollEvent ev)static voidio_uring_prep_fadvise(IOURingSQE sqe, int fd, int offset, long len, int advice)static voidio_uring_prep_fallocate(IOURingSQE sqe, int fd, int mode, long offset, long len)static voidio_uring_prep_files_update(IOURingSQE sqe, int[] fds, int offset)Array version of:prep_files_updatestatic voidio_uring_prep_files_update(IOURingSQE sqe, java.nio.IntBuffer fds, int offset)static voidio_uring_prep_fsync(IOURingSQE sqe, int fd, int fsync_flags)static voidio_uring_prep_link_timeout(IOURingSQE sqe, KernelTimespec ts, int flags)static voidio_uring_prep_linkat(IOURingSQE sqe, int olddfd, java.lang.CharSequence oldpath, int newdfd, java.lang.CharSequence newpath, int flags)static voidio_uring_prep_linkat(IOURingSQE sqe, int olddfd, java.nio.ByteBuffer oldpath, int newdfd, java.nio.ByteBuffer newpath, int flags)static voidio_uring_prep_madvise(IOURingSQE sqe, java.nio.ByteBuffer addr, int advice)static voidio_uring_prep_mkdirat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int mode)static voidio_uring_prep_mkdirat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int mode)static voidio_uring_prep_nop(IOURingSQE sqe)static voidio_uring_prep_openat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mode)static voidio_uring_prep_openat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mode)static voidio_uring_prep_openat_direct(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mode, int file_index)static voidio_uring_prep_openat_direct(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mode, int file_index)static voidio_uring_prep_openat2(IOURingSQE sqe, int dfd, java.lang.CharSequence path, OpenHow how)static voidio_uring_prep_openat2(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, OpenHow how)static voidio_uring_prep_openat2_direct(IOURingSQE sqe, int dfd, java.lang.CharSequence path, OpenHow how, int file_index)open directly into the fixed file tablestatic voidio_uring_prep_openat2_direct(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, OpenHow how, int file_index)open directly into the fixed file tablestatic voidio_uring_prep_poll_add(IOURingSQE sqe, int fd, int poll_mask)static voidio_uring_prep_poll_multishot(IOURingSQE sqe, int fd, int poll_mask)static voidio_uring_prep_poll_remove(IOURingSQE sqe, long user_data)static voidio_uring_prep_poll_update(IOURingSQE sqe, long old_user_data, long new_user_data, int poll_mask, int flags)static voidio_uring_prep_provide_buffers(IOURingSQE sqe, java.nio.ByteBuffer addr, int nr, int bgid, int bid)static voidio_uring_prep_read(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset)Prepares an IO read request.static voidio_uring_prep_read_fixed(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset, int buf_index)Prepares an IO read request with a previously registered IO buffer.static voidio_uring_prep_readv(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset)Prepares a vectored IO read request.static voidio_uring_prep_readv2(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset, int flags)Prepares a vectored IO read request.static voidio_uring_prep_recv(IOURingSQE sqe, int sockfd, java.nio.ByteBuffer buf, int flags)static voidio_uring_prep_recvmsg(IOURingSQE sqe, int fd, Msghdr msg, int flags)static voidio_uring_prep_remove_buffers(IOURingSQE sqe, int nr, int bgid)static voidio_uring_prep_renameat(IOURingSQE sqe, int olddfd, java.lang.CharSequence oldpath, int newdfd, java.lang.CharSequence newpath, int flags)static voidio_uring_prep_renameat(IOURingSQE sqe, int olddfd, java.nio.ByteBuffer oldpath, int newdfd, java.nio.ByteBuffer newpath, int flags)static voidio_uring_prep_send(IOURingSQE sqe, int sockfd, java.nio.ByteBuffer buf, int flags)static voidio_uring_prep_sendmsg(IOURingSQE sqe, int fd, Msghdr msg, int flags)static voidio_uring_prep_shutdown(IOURingSQE sqe, int fd, int how)static voidio_uring_prep_splice(IOURingSQE sqe, int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags)Precondition: Eitherfd_inorfd_outmust be a pipe.static voidio_uring_prep_statx(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mask, Statx statxbuf)static voidio_uring_prep_statx(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mask, Statx statxbuf)static voidio_uring_prep_symlinkat(IOURingSQE sqe, java.lang.CharSequence target, int newdirfd, java.lang.CharSequence linkpath)static voidio_uring_prep_symlinkat(IOURingSQE sqe, java.nio.ByteBuffer target, int newdirfd, java.nio.ByteBuffer linkpath)static voidio_uring_prep_sync_file_range(IOURingSQE sqe, int fd, int len, int offset, int flags)static voidio_uring_prep_tee(IOURingSQE sqe, int fd_in, int fd_out, int nbytes, int splice_flags)static voidio_uring_prep_timeout(IOURingSQE sqe, KernelTimespec ts, int count, int flags)static voidio_uring_prep_timeout_remove(IOURingSQE sqe, long user_data, int flags)static voidio_uring_prep_timeout_update(IOURingSQE sqe, KernelTimespec ts, long user_data, int flags)static voidio_uring_prep_unlinkat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags)static voidio_uring_prep_unlinkat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags)static voidio_uring_prep_write(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset)Prepares an IO write request.static voidio_uring_prep_write_fixed(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset, int buf_index)Prepares an IO write request with a previously registered IO buffer.static voidio_uring_prep_writev(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset)Prepares a vectored IO write request.static voidio_uring_prep_writev2(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset, int flags)Prepares a vectored IO write request.static voidio_uring_queue_exit(IOURing ring)Will release all resources acquired and initialized byqueue_init.static intio_uring_queue_init(int entries, IOURing ring, int flags)Executes thesetupsyscall to initialize the submission and completion queues in the kernel with at leastentriesentries and then maps the resulting file descriptor to memory shared between the application and the kernel.static intio_uring_queue_init_params(int entries, IOURing ring, IOURingParams p)static intio_uring_queue_mmap(int fd, IOURingParams p, IOURing ring)For users that want to specifysq_thread_cpuorsq_thread_idle, this interface is a convenient helper formmap()ing the rings.static intio_uring_register_buffers(IOURing ring, IOVec.Buffer iovecs)Registersnr_iovecsnumber of buffers defined by the arrayiovecsbelonging to thering.static intio_uring_register_buffers_tags(IOURing ring, IOVec.Buffer iovecs, long[] tags)Array version of:register_buffers_tagsstatic intio_uring_register_buffers_tags(IOURing ring, IOVec.Buffer iovecs, java.nio.LongBuffer tags)static intio_uring_register_buffers_update_tag(IOURing ring, int off, IOVec.Buffer iovecs, long[] tags)Array version of:register_buffers_update_tagstatic intio_uring_register_buffers_update_tag(IOURing ring, int off, IOVec.Buffer iovecs, java.nio.LongBuffer tags)static intio_uring_register_eventfd(IOURing ring, int fd)static intio_uring_register_eventfd_async(IOURing ring, int fd)static intio_uring_register_files(IOURing ring, int[] files)Array version of:register_filesstatic intio_uring_register_files(IOURing ring, java.nio.IntBuffer files)Registersnr_filesnumber of file descriptors defined by the arrayfilesbelonging to theringfor subsequent operations.static intio_uring_register_files_tags(IOURing ring, int[] files, long[] tags)Array version of:register_files_tagsstatic intio_uring_register_files_tags(IOURing ring, java.nio.IntBuffer files, java.nio.LongBuffer tags)static intio_uring_register_files_update(IOURing ring, int off, int[] files)Array version of:register_files_updatestatic intio_uring_register_files_update(IOURing ring, int off, java.nio.IntBuffer files)static intio_uring_register_files_update_tag(IOURing ring, int off, int[] files, long[] tags)Array version of:register_files_update_tagstatic intio_uring_register_files_update_tag(IOURing ring, int off, java.nio.IntBuffer files, java.nio.LongBuffer tags)static intio_uring_register_iowq_aff(IOURing ring, long cpusz, long mask)static intio_uring_register_iowq_max_workers(IOURing ring, int[] values)Array version of:register_iowq_max_workersstatic intio_uring_register_iowq_max_workers(IOURing ring, java.nio.IntBuffer values)static intio_uring_register_personality(IOURing ring)static intio_uring_register_probe(IOURing ring, IOURingProbe p, int nr)static intio_uring_register_restrictions(IOURing ring, IOURingRestriction.Buffer res)static intio_uring_ring_dontfork(IOURing ring)Ensure that themmap'ed rings aren't available to a child after afork(2).static intio_uring_sq_ready(IOURing ring)Returns the number of unconsumed (ifSQPOLL) or unsubmitted entries that exist in the SQ ring belonging to theringparam.static intio_uring_sq_space_left(IOURing ring)Returns how much space is left in the SQ ring belonging to theringparam.static voidio_uring_sqe_set_data(IOURingSQE sqe, long data)Stores auser_datapointer with the submission queue entrysqe.static voidio_uring_sqe_set_data64(IOURingSQE sqe, long data)Assign a 64-bit value to thissqe, which can get retrieved at completion time withcqe_get_data64.static voidio_uring_sqe_set_flags(IOURingSQE sqe, int flags)Allows the caller to change the behavior of the submission queue entry by specifying flags.static intio_uring_sqring_wait(IOURing ring)Allows the caller to wait for space to free up in the SQ ring belonging to theringparam, which happens when the kernel side thread has consumed one or more entries.static intio_uring_submit(IOURing ring)Submits the next events to the submission queue belonging to thering.static intio_uring_submit_and_wait(IOURing ring, int wait_nr)Submits the next events to the submission queue belonging to theringand waits forwait_nrcompletion events.static intio_uring_submit_and_wait_timeout(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, KernelTimespec ts, long sigmask)Submits the next events to the submission queue belonging to theringand waits forwait_nrcompletion events or until the timeouttsexpires.The completion events are stored in thecqe_ptrarray.static intio_uring_unregister_buffers(IOURing ring)Unregisters the fixed buffers previously registered to thering.static intio_uring_unregister_eventfd(IOURing ring)static intio_uring_unregister_files(IOURing ring)static intio_uring_unregister_iowq_aff(IOURing ring)static intio_uring_unregister_personality(IOURing ring, int id)static intio_uring_wait_cqe(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)Returns an IO completion from the queue belonging to theringparam, waiting for it if necessary.static intio_uring_wait_cqe_nr(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)Returnswait_nrIO completion events from the queue belonging to theringparam, waiting for it if necessary.static intio_uring_wait_cqe_timeout(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, KernelTimespec ts)Returns one IO completion from the queue belonging to theringparam, waiting for it if necessary or until the timeouttsexpires.static intio_uring_wait_cqes(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, KernelTimespec ts, long sigmask)Returnswait_nrIO completions from the queue belonging to theringparam, waiting for it if necessary or until the timeouttsexpires.static intn__io_uring_sqring_wait(long ring)static booleannio_uring_cq_eventfd_enabled(long ring)Unsafe version of:cq_eventfd_enabledstatic intnio_uring_cq_eventfd_toggle(long ring, boolean enabled)Unsafe version of:cq_eventfd_togglestatic intnio_uring_cq_ready(long ring)Unsafe version of:cq_readystatic longnio_uring_cqe_get_data(long cqe)Unsafe version of:cqe_get_datastatic longnio_uring_cqe_get_data64(long cqe)Unsafe version of:cqe_get_data64static voidnio_uring_cqe_seen(long ring, long cqe)Unsafe version of:cqe_seenstatic intnio_uring_enable_rings(long ring)static voidnio_uring_free_probe(long probe)Unsafe version of:free_probestatic longnio_uring_get_probe()Unsafe version of:get_probestatic longnio_uring_get_probe_ring(long ring)Unsafe version of:get_probe_ringstatic longnio_uring_get_sqe(long ring)Unsafe version of:get_sqestatic intnio_uring_mlock_size_params(int entries, long p)Unsafe version of:mlock_size_paramsstatic intnio_uring_opcode_supported(long p, int op)Unsafe version of:opcode_supportedstatic intnio_uring_peek_batch_cqe(long ring, long cqes, int count)Unsafe version of:peek_batch_cqestatic intnio_uring_peek_cqe(long ring, long cqe_ptr)Unsafe version of:peek_cqestatic voidnio_uring_prep_accept(long sqe, int fd, long addr, int[] addrlen, int flags)Array version of:nio_uring_prep_accept(long, int, long, long, int)static voidnio_uring_prep_accept(long sqe, int fd, long addr, long addrlen, int flags)static voidnio_uring_prep_accept_direct(long sqe, int fd, long addr, int[] addrlen, int flags, int file_index)Array version of:nio_uring_prep_accept_direct(long, int, long, long, int, int)static voidnio_uring_prep_accept_direct(long sqe, int fd, long addr, long addrlen, int flags, int file_index)static voidnio_uring_prep_cancel(long sqe, long user_data, int flags)static voidnio_uring_prep_close(long sqe, int fd)static voidnio_uring_prep_close_direct(long sqe, int file_index)static voidnio_uring_prep_connect(long sqe, int fd, long addr, int addrlen)static voidnio_uring_prep_epoll_ctl(long sqe, int epfd, int fd, int op, long ev)static voidnio_uring_prep_fadvise(long sqe, int fd, int offset, long len, int advice)static voidnio_uring_prep_fallocate(long sqe, int fd, int mode, long offset, long len)static voidnio_uring_prep_files_update(long sqe, int[] fds, int nr_fds, int offset)Array version of:nio_uring_prep_files_update(long, long, int, int)static voidnio_uring_prep_files_update(long sqe, long fds, int nr_fds, int offset)static voidnio_uring_prep_fsync(long sqe, int fd, int fsync_flags)static voidnio_uring_prep_link_timeout(long sqe, long ts, int flags)static voidnio_uring_prep_linkat(long sqe, int olddfd, long oldpath, int newdfd, long newpath, int flags)static voidnio_uring_prep_madvise(long sqe, long addr, long length, int advice)static voidnio_uring_prep_mkdirat(long sqe, int dfd, long path, int mode)static voidnio_uring_prep_nop(long sqe)static voidnio_uring_prep_openat(long sqe, int dfd, long path, int flags, int mode)static voidnio_uring_prep_openat_direct(long sqe, int dfd, long path, int flags, int mode, int file_index)static voidnio_uring_prep_openat2(long sqe, int dfd, long path, long how)static voidnio_uring_prep_openat2_direct(long sqe, int dfd, long path, long how, int file_index)Unsafe version of:prep_openat2_directstatic voidnio_uring_prep_poll_add(long sqe, int fd, int poll_mask)static voidnio_uring_prep_poll_multishot(long sqe, int fd, int poll_mask)static voidnio_uring_prep_poll_remove(long sqe, long user_data)static voidnio_uring_prep_poll_update(long sqe, long old_user_data, long new_user_data, int poll_mask, int flags)static voidnio_uring_prep_provide_buffers(long sqe, long addr, int len, int nr, int bgid, int bid)static voidnio_uring_prep_read(long sqe, int fd, long buf, int nbytes, int offset)Unsafe version of:prep_readstatic voidnio_uring_prep_read_fixed(long sqe, int fd, long buf, int nbytes, int offset, int buf_index)Unsafe version of:prep_read_fixedstatic voidnio_uring_prep_readv(long sqe, int fd, long iovecs, int nr_vecs, int offset)Unsafe version of:prep_readvstatic voidnio_uring_prep_readv2(long sqe, int fd, long iovecs, int nr_vecs, int offset, int flags)Unsafe version of:prep_readv2static voidnio_uring_prep_recv(long sqe, int sockfd, long buf, long len, int flags)static voidnio_uring_prep_recvmsg(long sqe, int fd, long msg, int flags)static voidnio_uring_prep_remove_buffers(long sqe, int nr, int bgid)static voidnio_uring_prep_renameat(long sqe, int olddfd, long oldpath, int newdfd, long newpath, int flags)static voidnio_uring_prep_send(long sqe, int sockfd, long buf, long len, int flags)static voidnio_uring_prep_sendmsg(long sqe, int fd, long msg, int flags)static voidnio_uring_prep_shutdown(long sqe, int fd, int how)static voidnio_uring_prep_splice(long sqe, int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags)Unsafe version of:prep_splicestatic voidnio_uring_prep_statx(long sqe, int dfd, long path, int flags, int mask, long statxbuf)static voidnio_uring_prep_symlinkat(long sqe, long target, int newdirfd, long linkpath)static voidnio_uring_prep_sync_file_range(long sqe, int fd, int len, int offset, int flags)static voidnio_uring_prep_tee(long sqe, int fd_in, int fd_out, int nbytes, int splice_flags)static voidnio_uring_prep_timeout(long sqe, long ts, int count, int flags)static voidnio_uring_prep_timeout_remove(long sqe, long user_data, int flags)static voidnio_uring_prep_timeout_update(long sqe, long ts, long user_data, int flags)static voidnio_uring_prep_unlinkat(long sqe, int dfd, long path, int flags)static voidnio_uring_prep_write(long sqe, int fd, long buf, int nbytes, int offset)Unsafe version of:prep_writestatic voidnio_uring_prep_write_fixed(long sqe, int fd, long buf, int nbytes, int offset, int buf_index)Unsafe version of:prep_write_fixedstatic voidnio_uring_prep_writev(long sqe, int fd, long iovecs, int nr_vecs, int offset)Unsafe version of:prep_writevstatic voidnio_uring_prep_writev2(long sqe, int fd, long iovecs, int nr_vecs, int offset, int flags)Unsafe version of:prep_writev2static voidnio_uring_queue_exit(long ring)Unsafe version of:queue_exitstatic intnio_uring_queue_init(int entries, long ring, int flags)Unsafe version of:queue_initstatic intnio_uring_queue_init_params(int entries, long ring, long p)static intnio_uring_queue_mmap(int fd, long p, long ring)Unsafe version of:queue_mmapstatic intnio_uring_register_buffers(long ring, long iovecs, int nr_iovecs)Unsafe version of:register_buffersstatic intnio_uring_register_buffers_tags(long ring, long iovecs, long[] tags, int nr)Array version of:nio_uring_register_buffers_tags(long, long, long, int)static intnio_uring_register_buffers_tags(long ring, long iovecs, long tags, int nr)static intnio_uring_register_buffers_update_tag(long ring, int off, long iovecs, long[] tags, int nr)Array version of:nio_uring_register_buffers_update_tag(long, int, long, long, int)static intnio_uring_register_buffers_update_tag(long ring, int off, long iovecs, long tags, int nr)static intnio_uring_register_eventfd(long ring, int fd)static intnio_uring_register_eventfd_async(long ring, int fd)static intnio_uring_register_files(long ring, int[] files, int nr_files)Array version of:nio_uring_register_files(long, long, int)static intnio_uring_register_files(long ring, long files, int nr_files)Unsafe version of:register_filesstatic intnio_uring_register_files_tags(long ring, int[] files, long[] tags, int nr)Array version of:nio_uring_register_files_tags(long, long, long, int)static intnio_uring_register_files_tags(long ring, long files, long tags, int nr)static intnio_uring_register_files_update(long ring, int off, int[] files, int nr_files)Array version of:nio_uring_register_files_update(long, int, long, int)static intnio_uring_register_files_update(long ring, int off, long files, int nr_files)static intnio_uring_register_files_update_tag(long ring, int off, int[] files, long[] tags, int nr_files)Array version of:nio_uring_register_files_update_tag(long, int, long, long, int)static intnio_uring_register_files_update_tag(long ring, int off, long files, long tags, int nr_files)static intnio_uring_register_iowq_aff(long ring, long cpusz, long mask)static intnio_uring_register_iowq_max_workers(long ring, int[] values)Array version of:nio_uring_register_iowq_max_workers(long, long)static intnio_uring_register_iowq_max_workers(long ring, long values)static intnio_uring_register_personality(long ring)static intnio_uring_register_probe(long ring, long p, int nr)static intnio_uring_register_restrictions(long ring, long res, int nr_res)static intnio_uring_ring_dontfork(long ring)Unsafe version of:ring_dontforkstatic intnio_uring_sq_ready(long ring)Unsafe version of:sq_readystatic intnio_uring_sq_space_left(long ring)Unsafe version of:sq_space_leftstatic voidnio_uring_sqe_set_data(long sqe, long data)Unsafe version of:sqe_set_datastatic voidnio_uring_sqe_set_data64(long sqe, long data)Unsafe version of:sqe_set_data64static voidnio_uring_sqe_set_flags(long sqe, int flags)Unsafe version of:sqe_set_flagsstatic intnio_uring_sqring_wait(long ring)Unsafe version of:sqring_waitstatic intnio_uring_submit(long ring)Unsafe version of:submitstatic intnio_uring_submit_and_wait(long ring, int wait_nr)Unsafe version of:submit_and_waitstatic intnio_uring_submit_and_wait_timeout(long ring, long cqe_ptr, int wait_nr, long ts, long sigmask)Unsafe version of:submit_and_wait_timeoutstatic intnio_uring_unregister_buffers(long ring)Unsafe version of:unregister_buffersstatic intnio_uring_unregister_eventfd(long ring)static intnio_uring_unregister_files(long ring)static intnio_uring_unregister_iowq_aff(long ring)static intnio_uring_unregister_personality(long ring, int id)static intnio_uring_wait_cqe(long ring, long cqe_ptr)Unsafe version of:wait_cqestatic intnio_uring_wait_cqe_nr(long ring, long cqe_ptr, int wait_nr)Unsafe version of:wait_cqe_nrstatic intnio_uring_wait_cqe_timeout(long ring, long cqe_ptr, long ts)Unsafe version of:wait_cqe_timeoutstatic intnio_uring_wait_cqes(long ring, long cqe_ptr, int wait_nr, long ts, long sigmask)Unsafe version of:wait_cqes
-
-
-
Field Detail
-
LIBURING_UDATA_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
nio_uring_get_probe_ring
public static long nio_uring_get_probe_ring(long ring)
Unsafe version of:get_probe_ring
-
io_uring_get_probe_ring
@Nullable public static IOURingProbe io_uring_get_probe_ring(IOURing ring)
Return an allocatedio_uring_probestructure, orNULLif probe fails (for example, if it is not available).The caller is responsible for freeing it.
-
nio_uring_get_probe
public static long nio_uring_get_probe()
Unsafe version of:get_probe
-
io_uring_get_probe
@Nullable public static IOURingProbe io_uring_get_probe()
Returns an allocatedio_uring_probestructure to the caller.The caller is responsible for freeing the structure with the function
free_probe.Note: Earlier versions of the Linux kernel (≤ 5.5) do not support probe. If the kernel doesn't support probe, this function will return
NULL.
-
nio_uring_free_probe
public static void nio_uring_free_probe(long probe)
Unsafe version of:free_probe
-
io_uring_free_probe
public static void io_uring_free_probe(IOURingProbe probe)
Frees theprobeinstance allocated with theget_probefunction.
-
nio_uring_opcode_supported
public static int nio_uring_opcode_supported(long p, int op)Unsafe version of:opcode_supported
-
io_uring_opcode_supported
public static int io_uring_opcode_supported(IOURingProbe p, int op)
Allows the caller to determine if the passed inopcodebelonging to theprobeparam is supported.An instance of the
io_uring_probeinstance can be obtained by calling the functionget_probe.
-
nio_uring_queue_init_params
public static int nio_uring_queue_init_params(int entries, long ring, long p)
-
io_uring_queue_init_params
public static int io_uring_queue_init_params(int entries, IOURing ring, IOURingParams p)
-
nio_uring_queue_init
public static int nio_uring_queue_init(int entries, long ring, int flags)Unsafe version of:queue_init
-
io_uring_queue_init
public static int io_uring_queue_init(int entries, IOURing ring, int flags)Executes thesetupsyscall to initialize the submission and completion queues in the kernel with at leastentriesentries and then maps the resulting file descriptor to memory shared between the application and the kernel.On success, the resources held by
ringshould be released via a corresponding call toqueue_exit.- Parameters:
flags- will be passed through to thesetupsyscall- Returns:
- 0 on success and
ringwill point to the shared memory containing theio_uringqueues. On failure-errnois returned.
-
nio_uring_queue_mmap
public static int nio_uring_queue_mmap(int fd, long p, long ring)Unsafe version of:queue_mmap
-
io_uring_queue_mmap
public static int io_uring_queue_mmap(int fd, IOURingParams p, IOURing ring)For users that want to specifysq_thread_cpuorsq_thread_idle, this interface is a convenient helper formmap()ing the rings.- Parameters:
fd- a file descriptor returned bysetupring- on success, contains the necessary information to read/write to the rings- Returns:
-errnoon error, or zero on success
-
nio_uring_ring_dontfork
public static int nio_uring_ring_dontfork(long ring)
Unsafe version of:ring_dontfork
-
io_uring_ring_dontfork
public static int io_uring_ring_dontfork(IOURing ring)
Ensure that themmap'ed rings aren't available to a child after afork(2).This uses
madvise(..., MADV_DONTFORK)on themmap'ed ranges.
-
nio_uring_queue_exit
public static void nio_uring_queue_exit(long ring)
Unsafe version of:queue_exit
-
io_uring_queue_exit
public static void io_uring_queue_exit(IOURing ring)
Will release all resources acquired and initialized byqueue_init.It first unmaps the memory shared between the application and the kernel and then closes the
io_uringfile descriptor.
-
nio_uring_peek_batch_cqe
public static int nio_uring_peek_batch_cqe(long ring, long cqes, int count)Unsafe version of:peek_batch_cqe
-
io_uring_peek_batch_cqe
public static int io_uring_peek_batch_cqe(IOURing ring, org.lwjgl.PointerBuffer cqes)
Fill in an array of IO completions up to count, if any are available.- Returns:
- the amount of IO completions filled
-
nio_uring_wait_cqes
public static int nio_uring_wait_cqes(long ring, long cqe_ptr, int wait_nr, long ts, long sigmask)Unsafe version of:wait_cqes
-
io_uring_wait_cqes
public static int io_uring_wait_cqes(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, @Nullable KernelTimespec ts, long sigmask)
Returnswait_nrIO completions from the queue belonging to theringparam, waiting for it if necessary or until the timeouttsexpires.If
tsis specified, the application does not need to callsubmitbefore callingio_uring_wait_cqes().- Parameters:
cqe_ptr- filled in on successsigmask- the set of signals to block. The prevailing signal mask is restored before returning.- Returns:
- 0 on success and the
cqe_ptrparam is filled in. On failure it returns-errno.
-
nio_uring_wait_cqe_timeout
public static int nio_uring_wait_cqe_timeout(long ring, long cqe_ptr, long ts)Unsafe version of:wait_cqe_timeout
-
io_uring_wait_cqe_timeout
public static int io_uring_wait_cqe_timeout(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, @Nullable KernelTimespec ts)
Returns one IO completion from the queue belonging to theringparam, waiting for it if necessary or until the timeouttsexpires.If
tsis specified, the application does not need to callsubmitbefore callingio_uring_wait_cqe_timeout().- Parameters:
cqe_ptr- filled in on success- Returns:
- 0 on success and the
cqe_ptrparam is filled in. On failure it returns-errno.
-
nio_uring_submit
public static int nio_uring_submit(long ring)
Unsafe version of:submit
-
io_uring_submit
public static int io_uring_submit(IOURing ring)
Submits the next events to the submission queue belonging to thering.After the caller retrieves a submission queue entry (SQE) with
get_sqe, prepares the SQE, it can be submitted withio_uring_submit().- Returns:
- the number of submitted submission queue entries on success. On failure it returns
-errno.
-
nio_uring_submit_and_wait
public static int nio_uring_submit_and_wait(long ring, int wait_nr)Unsafe version of:submit_and_wait
-
io_uring_submit_and_wait
public static int io_uring_submit_and_wait(IOURing ring, int wait_nr)
Submits the next events to the submission queue belonging to theringand waits forwait_nrcompletion events.After the caller retrieves a submission queue entry (SQE) with
get_sqe, prepares the SQE, it can be submitted withio_uring_submit_and_wait().- Returns:
- the number of submitted submission queue entries on success. On failure it returns
-errno.
-
nio_uring_submit_and_wait_timeout
public static int nio_uring_submit_and_wait_timeout(long ring, long cqe_ptr, int wait_nr, long ts, long sigmask)Unsafe version of:submit_and_wait_timeout
-
io_uring_submit_and_wait_timeout
public static int io_uring_submit_and_wait_timeout(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr, @Nullable KernelTimespec ts, long sigmask)
Submits the next events to the submission queue belonging to theringand waits forwait_nrcompletion events or until the timeouttsexpires.The completion events are stored in thecqe_ptrarray.After the caller retrieves a submission queue entry (SQE) with
get_sqe, prepares the SQE, it can be submitted withio_uring_submit_and_wait_timeout().- Parameters:
sigmask- the set of signals to block. The prevailing signal mask is restored before returning.- Returns:
- the number of submitted submission queue entries on success. On failure it returns
-errno.
-
nio_uring_get_sqe
public static long nio_uring_get_sqe(long ring)
Unsafe version of:get_sqe
-
io_uring_get_sqe
@Nullable public static IOURingSQE io_uring_get_sqe(IOURing ring)
Gets the next available submission queue entry from the submission queue belonging to theringparam.If a submission queue event is returned, it should be filled out via one of the prep functions such as
prep_readand submitted viasubmit.- Returns:
- a pointer to the next submission queue event on success and
NULLon failure
-
nio_uring_register_buffers
public static int nio_uring_register_buffers(long ring, long iovecs, int nr_iovecs)Unsafe version of:register_buffers
-
io_uring_register_buffers
public static int io_uring_register_buffers(IOURing ring, IOVec.Buffer iovecs)
Registersnr_iovecsnumber of buffers defined by the arrayiovecsbelonging to thering.After the caller has registered the buffers, they can be used with one of the fixed buffers functions.
Registered buffers is an optimization that is useful in conjunction with
O_DIRECTreads and writes, where maps the specified range into the kernel once when the buffer is registered, rather than doing a map and unmap for each IO every time IO is performed to that region. Additionally, it also avoids manipulating the page reference counts for each IO.- Returns:
- 0 on success. On failure it returns
-errno.
-
nio_uring_register_buffers_tags
public static int nio_uring_register_buffers_tags(long ring, long iovecs, long tags, int nr)
-
io_uring_register_buffers_tags
public static int io_uring_register_buffers_tags(IOURing ring, IOVec.Buffer iovecs, java.nio.LongBuffer tags)
-
nio_uring_register_buffers_update_tag
public static int nio_uring_register_buffers_update_tag(long ring, int off, long iovecs, long tags, int nr)
-
io_uring_register_buffers_update_tag
public static int io_uring_register_buffers_update_tag(IOURing ring, int off, IOVec.Buffer iovecs, java.nio.LongBuffer tags)
-
nio_uring_unregister_buffers
public static int nio_uring_unregister_buffers(long ring)
Unsafe version of:unregister_buffers
-
io_uring_unregister_buffers
public static int io_uring_unregister_buffers(IOURing ring)
Unregisters the fixed buffers previously registered to thering.- Returns:
- 0 on success. On failure it returns
-errno.
-
nio_uring_register_files
public static int nio_uring_register_files(long ring, long files, int nr_files)Unsafe version of:register_files
-
io_uring_register_files
public static int io_uring_register_files(IOURing ring, java.nio.IntBuffer files)
Registersnr_filesnumber of file descriptors defined by the arrayfilesbelonging to theringfor subsequent operations.After the caller has registered the buffers, they can be used with the submission queue polling operations.
- Returns:
- 0 on success. On failure it returns
-errno.
-
nio_uring_register_files_tags
public static int nio_uring_register_files_tags(long ring, long files, long tags, int nr)
-
io_uring_register_files_tags
public static int io_uring_register_files_tags(IOURing ring, java.nio.IntBuffer files, java.nio.LongBuffer tags)
-
nio_uring_register_files_update_tag
public static int nio_uring_register_files_update_tag(long ring, int off, long files, long tags, int nr_files)
-
io_uring_register_files_update_tag
public static int io_uring_register_files_update_tag(IOURing ring, int off, java.nio.IntBuffer files, java.nio.LongBuffer tags)
-
nio_uring_unregister_files
public static int nio_uring_unregister_files(long ring)
-
io_uring_unregister_files
public static int io_uring_unregister_files(IOURing ring)
-
nio_uring_register_files_update
public static int nio_uring_register_files_update(long ring, int off, long files, int nr_files)
-
io_uring_register_files_update
public static int io_uring_register_files_update(IOURing ring, int off, java.nio.IntBuffer files)
-
nio_uring_register_eventfd
public static int nio_uring_register_eventfd(long ring, int fd)
-
io_uring_register_eventfd
public static int io_uring_register_eventfd(IOURing ring, int fd)
-
nio_uring_register_eventfd_async
public static int nio_uring_register_eventfd_async(long ring, int fd)
-
io_uring_register_eventfd_async
public static int io_uring_register_eventfd_async(IOURing ring, int fd)
-
nio_uring_unregister_eventfd
public static int nio_uring_unregister_eventfd(long ring)
-
io_uring_unregister_eventfd
public static int io_uring_unregister_eventfd(IOURing ring)
-
nio_uring_register_probe
public static int nio_uring_register_probe(long ring, long p, int nr)
-
io_uring_register_probe
public static int io_uring_register_probe(IOURing ring, IOURingProbe p, int nr)
-
nio_uring_register_personality
public static int nio_uring_register_personality(long ring)
-
io_uring_register_personality
public static int io_uring_register_personality(IOURing ring)
-
nio_uring_unregister_personality
public static int nio_uring_unregister_personality(long ring, int id)
-
io_uring_unregister_personality
public static int io_uring_unregister_personality(IOURing ring, int id)
-
nio_uring_register_restrictions
public static int nio_uring_register_restrictions(long ring, long res, int nr_res)
-
io_uring_register_restrictions
public static int io_uring_register_restrictions(IOURing ring, IOURingRestriction.Buffer res)
-
nio_uring_enable_rings
public static int nio_uring_enable_rings(long ring)
-
io_uring_enable_rings
public static int io_uring_enable_rings(IOURing ring)
-
n__io_uring_sqring_wait
public static int n__io_uring_sqring_wait(long ring)
-
__io_uring_sqring_wait
public static int __io_uring_sqring_wait(IOURing ring)
-
nio_uring_register_iowq_aff
public static int nio_uring_register_iowq_aff(long ring, long cpusz, long mask)
-
io_uring_register_iowq_aff
public static int io_uring_register_iowq_aff(IOURing ring, long cpusz, long mask)
-
nio_uring_unregister_iowq_aff
public static int nio_uring_unregister_iowq_aff(long ring)
-
io_uring_unregister_iowq_aff
public static int io_uring_unregister_iowq_aff(IOURing ring)
-
nio_uring_register_iowq_max_workers
public static int nio_uring_register_iowq_max_workers(long ring, long values)
-
io_uring_register_iowq_max_workers
public static int io_uring_register_iowq_max_workers(IOURing ring, java.nio.IntBuffer values)
-
nio_uring_cqe_seen
public static void nio_uring_cqe_seen(long ring, long cqe)Unsafe version of:cqe_seen
-
io_uring_cqe_seen
public static void io_uring_cqe_seen(IOURing ring, IOURingCQE cqe)
-
nio_uring_sqe_set_data
public static void nio_uring_sqe_set_data(long sqe, long data)Unsafe version of:sqe_set_data
-
io_uring_sqe_set_data
public static void io_uring_sqe_set_data(IOURingSQE sqe, long data)
Stores auser_datapointer with the submission queue entrysqe.After the caller has requested an submission queue entry (SQE) with
get_sqe, they can associate a data pointer with the SQE. Once the completion arrives, the functioncqe_get_datacan be called to identify the user request.
-
nio_uring_cqe_get_data
public static long nio_uring_cqe_get_data(long cqe)
Unsafe version of:cqe_get_data
-
io_uring_cqe_get_data
public static long io_uring_cqe_get_data(IOURingCQE cqe)
Returns theuser_datawith the completion queue entrycqe.After the caller has received a completion queue entry (CQE) with
wait_cqe, they can call theio_uring_cqe_get_data()function to retrieve theuser_datavalue. This requires thatuser_datahas been set earlier with the functionsqe_set_data.
-
nio_uring_sqe_set_data64
public static void nio_uring_sqe_set_data64(long sqe, long data)Unsafe version of:sqe_set_data64
-
io_uring_sqe_set_data64
public static void io_uring_sqe_set_data64(IOURingSQE sqe, long data)
Assign a 64-bit value to thissqe, which can get retrieved at completion time withcqe_get_data64.Just like the non-64 variants, except these store a 64-bit type rather than a data pointer.
-
nio_uring_cqe_get_data64
public static long nio_uring_cqe_get_data64(long cqe)
Unsafe version of:cqe_get_data64
-
io_uring_cqe_get_data64
public static long io_uring_cqe_get_data64(IOURingCQE cqe)
Seesqe_set_data64.
-
nio_uring_sqe_set_flags
public static void nio_uring_sqe_set_flags(long sqe, int flags)Unsafe version of:sqe_set_flags
-
io_uring_sqe_set_flags
public static void io_uring_sqe_set_flags(IOURingSQE sqe, int flags)
Allows the caller to change the behavior of the submission queue entry by specifying flags.It enables the
flagsbelonging to thesqesubmission queue entry param.
-
nio_uring_prep_splice
public static void nio_uring_prep_splice(long sqe, int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags)Unsafe version of:prep_splice
-
io_uring_prep_splice
public static void io_uring_prep_splice(IOURingSQE sqe, int fd_in, long off_in, int fd_out, long off_out, int nbytes, int splice_flags)
Precondition: Eitherfd_inorfd_outmust be a pipe.This splice operation can be used to implement
sendfileby splicing to an intermediate pipe first, then splice to the final destination. In fact, the implementation ofsendfilein kernel usesspliceinternally.NOTE that even if
fd_inorfd_outrefers to a pipe, the splice operation can still failed withEINVALif one of the fd doesn't explicitly support splice operation, e.g. reading from terminal is unsupported from kernel 5.7 to 5.11. Check issue #291 for more information.- Parameters:
off_in- iffd_inrefers to a pipe,off_inmust be(int64_t) -1; Iffd_indoes not refer to a pipe andoff_inis(int64_t) -1, then bytes are read fromfd_instarting from the file offset and it is adjust appropriately; Iffd_indoes not refer to a pipe andoff_inis not(int64_t) -1, then the startingoffsetoffd_inwill beoff_in.off_out- the description ofoff_inalso applied tooff_outsplice_flags- see mansplice(2)for description of flags
-
nio_uring_prep_tee
public static void nio_uring_prep_tee(long sqe, int fd_in, int fd_out, int nbytes, int splice_flags)
-
io_uring_prep_tee
public static void io_uring_prep_tee(IOURingSQE sqe, int fd_in, int fd_out, int nbytes, int splice_flags)
-
nio_uring_prep_readv
public static void nio_uring_prep_readv(long sqe, int fd, long iovecs, int nr_vecs, int offset)Unsafe version of:prep_readv
-
io_uring_prep_readv
public static void io_uring_prep_readv(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset)
Prepares a vectored IO read request.The submission queue entry
sqeis setup to use the file descriptorfdto start readingnr_vecsinto theiovecsarray at the specifiedoffset.On files that support seeking, if the
offsetis set to -1, the read operation commences at the file offset, and the file offset is incremented by the number of bytes read. Seeread(2)for more details.On files that are not capable of seeking, the offset is ignored.
After the write has been prepared it can be submitted with one of the submit functions.
-
nio_uring_prep_readv2
public static void nio_uring_prep_readv2(long sqe, int fd, long iovecs, int nr_vecs, int offset, int flags)Unsafe version of:prep_readv2
-
io_uring_prep_readv2
public static void io_uring_prep_readv2(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset, int flags)
Prepares a vectored IO read request.The submission queue entry
sqeis setup to use the file descriptorfdto start readingnr_vecsinto theiovecsarray at the specifiedoffset.The behavior of the function can be controlled with the
flagsparameter. Supported values for flags are:RWF_HIPRI- High priority request, poll if possibleRWF_DSYNC- per-IOO_DSYNCRWF_SYNC- per-IOO_SYNCRWF_NOWAIT- per-IO, return-EAGAINif operation would blockRWF_APPEND- per-IOO_APPEND
On files that support seeking, if the
offsetis set to -1, the read operation commences at the file offset, and the file offset is incremented by the number of bytes read. Seeread(2)for more details.On files that are not capable of seeking, the offset is ignored.
After the write has been prepared, it can be submitted with one of the submit functions.
-
nio_uring_prep_read_fixed
public static void nio_uring_prep_read_fixed(long sqe, int fd, long buf, int nbytes, int offset, int buf_index)Unsafe version of:prep_read_fixed
-
io_uring_prep_read_fixed
public static void io_uring_prep_read_fixed(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset, int buf_index)
Prepares an IO read request with a previously registered IO buffer.The submission queue entry
sqeis setup to use the file descriptorfdto start readingnbytesinto the bufferbufat the specifiedoffset, and with the buffer matching the registered index ofbuf_index.This work just like
prep_readexcept it requires the user of buffers that have been registered withregister_buffers. Thebufandnbytesarguments must fall within a region specificed bybuf_indexin the previously registered buffer. The buffer need not be aligned with the start of the registered buffer.After the read has been prepared it can be submitted with one of the submit functions.
-
nio_uring_prep_writev
public static void nio_uring_prep_writev(long sqe, int fd, long iovecs, int nr_vecs, int offset)Unsafe version of:prep_writev
-
io_uring_prep_writev
public static void io_uring_prep_writev(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset)
Prepares a vectored IO write request.The submission queue entry
sqeis setup to use the file descriptorfdto start writingnr_vecsfrom theiovecsarray at the specifiedoffset.On files that support seeking, if the
offsetis set to -1, the write operation commences at the file offset, and the file offset is incremented by the number of bytes written. Seewrite(2)for more details.On files that are not capable of seeking, the offset is ignored.
After the write has been prepared it can be submitted with one of the submit functions.
-
nio_uring_prep_writev2
public static void nio_uring_prep_writev2(long sqe, int fd, long iovecs, int nr_vecs, int offset, int flags)Unsafe version of:prep_writev2
-
io_uring_prep_writev2
public static void io_uring_prep_writev2(IOURingSQE sqe, int fd, IOVec.Buffer iovecs, int offset, int flags)
Prepares a vectored IO write request.The submission queue entry
sqeis setup to use the file descriptorfdto start writingnr_vecsfrom theiovecsarray at the specifiedoffset.The behavior of the function can be controlled with the
flagsparameter. Supported values for flags are:RWF_HIPRI- High priority request, poll if possibleRWF_DSYNC- per-IOO_DSYNCRWF_SYNC- per-IOO_SYNCRWF_NOWAIT- per-IO, return-EAGAINif operation would blockRWF_APPEND- per-IOO_APPEND
On files that support seeking, if the
offsetis set to -1, the write operation commences at the file offset, and the file offset is incremented by the number of bytes written. Seewrite(2)for more details.On files that are not capable of seeking, the offset is ignored.
After the write has been prepared, it can be submitted with one of the submit functions.
-
nio_uring_prep_write_fixed
public static void nio_uring_prep_write_fixed(long sqe, int fd, long buf, int nbytes, int offset, int buf_index)Unsafe version of:prep_write_fixed
-
io_uring_prep_write_fixed
public static void io_uring_prep_write_fixed(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset, int buf_index)
Prepares an IO write request with a previously registered IO buffer.The submission queue entry
sqeis setup to use the file descriptorfdto start writingnbytesfrom the bufferbufat the specifiedoffset, and with the buffer matching the registered index ofbuf_index.This work just like
prep_writeexcept it requires the user of buffers that have been registered withregister_buffers. Thebufandnbytesarguments must fall within a region specificed bybuf_indexin the previously registered buffer. The buffer need not be aligned with the start of the registered buffer.After the read has been prepared it can be submitted with one of the submit functions.
-
nio_uring_prep_recvmsg
public static void nio_uring_prep_recvmsg(long sqe, int fd, long msg, int flags)
-
io_uring_prep_recvmsg
public static void io_uring_prep_recvmsg(IOURingSQE sqe, int fd, Msghdr msg, int flags)
-
nio_uring_prep_sendmsg
public static void nio_uring_prep_sendmsg(long sqe, int fd, long msg, int flags)
-
io_uring_prep_sendmsg
public static void io_uring_prep_sendmsg(IOURingSQE sqe, int fd, Msghdr msg, int flags)
-
nio_uring_prep_poll_add
public static void nio_uring_prep_poll_add(long sqe, int fd, int poll_mask)
-
io_uring_prep_poll_add
public static void io_uring_prep_poll_add(IOURingSQE sqe, int fd, int poll_mask)
-
nio_uring_prep_poll_multishot
public static void nio_uring_prep_poll_multishot(long sqe, int fd, int poll_mask)
-
io_uring_prep_poll_multishot
public static void io_uring_prep_poll_multishot(IOURingSQE sqe, int fd, int poll_mask)
-
nio_uring_prep_poll_remove
public static void nio_uring_prep_poll_remove(long sqe, long user_data)
-
io_uring_prep_poll_remove
public static void io_uring_prep_poll_remove(IOURingSQE sqe, long user_data)
-
nio_uring_prep_poll_update
public static void nio_uring_prep_poll_update(long sqe, long old_user_data, long new_user_data, int poll_mask, int flags)
-
io_uring_prep_poll_update
public static void io_uring_prep_poll_update(IOURingSQE sqe, long old_user_data, long new_user_data, int poll_mask, int flags)
-
nio_uring_prep_fsync
public static void nio_uring_prep_fsync(long sqe, int fd, int fsync_flags)
-
io_uring_prep_fsync
public static void io_uring_prep_fsync(IOURingSQE sqe, int fd, int fsync_flags)
-
nio_uring_prep_nop
public static void nio_uring_prep_nop(long sqe)
-
io_uring_prep_nop
public static void io_uring_prep_nop(IOURingSQE sqe)
-
nio_uring_prep_timeout
public static void nio_uring_prep_timeout(long sqe, long ts, int count, int flags)
-
io_uring_prep_timeout
public static void io_uring_prep_timeout(IOURingSQE sqe, KernelTimespec ts, int count, int flags)
-
nio_uring_prep_timeout_remove
public static void nio_uring_prep_timeout_remove(long sqe, long user_data, int flags)
-
io_uring_prep_timeout_remove
public static void io_uring_prep_timeout_remove(IOURingSQE sqe, long user_data, int flags)
-
nio_uring_prep_timeout_update
public static void nio_uring_prep_timeout_update(long sqe, long ts, long user_data, int flags)
-
io_uring_prep_timeout_update
public static void io_uring_prep_timeout_update(IOURingSQE sqe, KernelTimespec ts, long user_data, int flags)
-
nio_uring_prep_accept
public static void nio_uring_prep_accept(long sqe, int fd, long addr, long addrlen, int flags)
-
io_uring_prep_accept
public static void io_uring_prep_accept(IOURingSQE sqe, int fd, Sockaddr addr, java.nio.IntBuffer addrlen, int flags)
-
nio_uring_prep_accept_direct
public static void nio_uring_prep_accept_direct(long sqe, int fd, long addr, long addrlen, int flags, int file_index)
-
io_uring_prep_accept_direct
public static void io_uring_prep_accept_direct(IOURingSQE sqe, int fd, Sockaddr addr, java.nio.IntBuffer addrlen, int flags, int file_index)
-
nio_uring_prep_cancel
public static void nio_uring_prep_cancel(long sqe, long user_data, int flags)
-
io_uring_prep_cancel
public static void io_uring_prep_cancel(IOURingSQE sqe, long user_data, int flags)
-
nio_uring_prep_link_timeout
public static void nio_uring_prep_link_timeout(long sqe, long ts, int flags)
-
io_uring_prep_link_timeout
public static void io_uring_prep_link_timeout(IOURingSQE sqe, KernelTimespec ts, int flags)
-
nio_uring_prep_connect
public static void nio_uring_prep_connect(long sqe, int fd, long addr, int addrlen)
-
io_uring_prep_connect
public static void io_uring_prep_connect(IOURingSQE sqe, int fd, Sockaddr addr, int addrlen)
-
nio_uring_prep_files_update
public static void nio_uring_prep_files_update(long sqe, long fds, int nr_fds, int offset)
-
io_uring_prep_files_update
public static void io_uring_prep_files_update(IOURingSQE sqe, java.nio.IntBuffer fds, int offset)
-
nio_uring_prep_fallocate
public static void nio_uring_prep_fallocate(long sqe, int fd, int mode, long offset, long len)
-
io_uring_prep_fallocate
public static void io_uring_prep_fallocate(IOURingSQE sqe, int fd, int mode, long offset, long len)
-
nio_uring_prep_openat
public static void nio_uring_prep_openat(long sqe, int dfd, long path, int flags, int mode)
-
io_uring_prep_openat
public static void io_uring_prep_openat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mode)
-
io_uring_prep_openat
public static void io_uring_prep_openat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mode)
-
nio_uring_prep_openat_direct
public static void nio_uring_prep_openat_direct(long sqe, int dfd, long path, int flags, int mode, int file_index)
-
io_uring_prep_openat_direct
public static void io_uring_prep_openat_direct(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mode, int file_index)
-
io_uring_prep_openat_direct
public static void io_uring_prep_openat_direct(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mode, int file_index)
-
nio_uring_prep_close
public static void nio_uring_prep_close(long sqe, int fd)
-
io_uring_prep_close
public static void io_uring_prep_close(IOURingSQE sqe, int fd)
-
nio_uring_prep_close_direct
public static void nio_uring_prep_close_direct(long sqe, int file_index)
-
io_uring_prep_close_direct
public static void io_uring_prep_close_direct(IOURingSQE sqe, int file_index)
-
nio_uring_prep_read
public static void nio_uring_prep_read(long sqe, int fd, long buf, int nbytes, int offset)Unsafe version of:prep_read
-
io_uring_prep_read
public static void io_uring_prep_read(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset)
Prepares an IO read request.The submission queue entry
sqeis setup to use the file descriptorfdto start readingnbytesinto the bufferbufat the specifiedoffset.On files that support seeking, if the
offsetis set to -1, the read operation commences at the file offset, and the file offset is incremented by the number of bytes read. Seeread(2)for more details.On files that are not capable of seeking, the
offsetis ignored.After the read has been prepared it can be submitted with one of the submit functions.
-
nio_uring_prep_write
public static void nio_uring_prep_write(long sqe, int fd, long buf, int nbytes, int offset)Unsafe version of:prep_write
-
io_uring_prep_write
public static void io_uring_prep_write(IOURingSQE sqe, int fd, java.nio.ByteBuffer buf, int offset)
Prepares an IO write request.The submission queue entry
sqeis setup to use the file descriptorfdto start writingnbytesfrom the bufferbufat the specifiedoffset.On files that support seeking, if the
offsetis set to -1, the write operation commences at the file offset, and the file offset is incremented by the number of bytes written. Seewrite(2)for more details.On files that are not capable of seeking, the offset is ignored.
After the write has been prepared, it can be submitted with one of the submit functions.
-
nio_uring_prep_statx
public static void nio_uring_prep_statx(long sqe, int dfd, long path, int flags, int mask, long statxbuf)
-
io_uring_prep_statx
public static void io_uring_prep_statx(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags, int mask, Statx statxbuf)
-
io_uring_prep_statx
public static void io_uring_prep_statx(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags, int mask, Statx statxbuf)
-
nio_uring_prep_fadvise
public static void nio_uring_prep_fadvise(long sqe, int fd, int offset, long len, int advice)
-
io_uring_prep_fadvise
public static void io_uring_prep_fadvise(IOURingSQE sqe, int fd, int offset, long len, int advice)
-
nio_uring_prep_madvise
public static void nio_uring_prep_madvise(long sqe, long addr, long length, int advice)
-
io_uring_prep_madvise
public static void io_uring_prep_madvise(IOURingSQE sqe, java.nio.ByteBuffer addr, int advice)
-
nio_uring_prep_send
public static void nio_uring_prep_send(long sqe, int sockfd, long buf, long len, int flags)
-
io_uring_prep_send
public static void io_uring_prep_send(IOURingSQE sqe, int sockfd, java.nio.ByteBuffer buf, int flags)
-
nio_uring_prep_recv
public static void nio_uring_prep_recv(long sqe, int sockfd, long buf, long len, int flags)
-
io_uring_prep_recv
public static void io_uring_prep_recv(IOURingSQE sqe, int sockfd, java.nio.ByteBuffer buf, int flags)
-
nio_uring_prep_openat2
public static void nio_uring_prep_openat2(long sqe, int dfd, long path, long how)
-
io_uring_prep_openat2
public static void io_uring_prep_openat2(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, OpenHow how)
-
io_uring_prep_openat2
public static void io_uring_prep_openat2(IOURingSQE sqe, int dfd, java.lang.CharSequence path, OpenHow how)
-
nio_uring_prep_openat2_direct
public static void nio_uring_prep_openat2_direct(long sqe, int dfd, long path, long how, int file_index)Unsafe version of:prep_openat2_direct
-
io_uring_prep_openat2_direct
public static void io_uring_prep_openat2_direct(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, OpenHow how, int file_index) public static void io_uring_prep_openat2_direct(IOURingSQE sqe, int dfd, java.lang.CharSequence path, OpenHow how, int file_index)
open directly into the fixed file table
-
nio_uring_prep_epoll_ctl
public static void nio_uring_prep_epoll_ctl(long sqe, int epfd, int fd, int op, long ev)
-
io_uring_prep_epoll_ctl
public static void io_uring_prep_epoll_ctl(IOURingSQE sqe, int epfd, int fd, int op, EpollEvent ev)
-
nio_uring_prep_provide_buffers
public static void nio_uring_prep_provide_buffers(long sqe, long addr, int len, int nr, int bgid, int bid)
-
io_uring_prep_provide_buffers
public static void io_uring_prep_provide_buffers(IOURingSQE sqe, java.nio.ByteBuffer addr, int nr, int bgid, int bid)
-
nio_uring_prep_remove_buffers
public static void nio_uring_prep_remove_buffers(long sqe, int nr, int bgid)
-
io_uring_prep_remove_buffers
public static void io_uring_prep_remove_buffers(IOURingSQE sqe, int nr, int bgid)
-
nio_uring_prep_shutdown
public static void nio_uring_prep_shutdown(long sqe, int fd, int how)
-
io_uring_prep_shutdown
public static void io_uring_prep_shutdown(IOURingSQE sqe, int fd, int how)
-
nio_uring_prep_unlinkat
public static void nio_uring_prep_unlinkat(long sqe, int dfd, long path, int flags)
-
io_uring_prep_unlinkat
public static void io_uring_prep_unlinkat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int flags)
-
io_uring_prep_unlinkat
public static void io_uring_prep_unlinkat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int flags)
-
nio_uring_prep_renameat
public static void nio_uring_prep_renameat(long sqe, int olddfd, long oldpath, int newdfd, long newpath, int flags)
-
io_uring_prep_renameat
public static void io_uring_prep_renameat(IOURingSQE sqe, int olddfd, java.nio.ByteBuffer oldpath, int newdfd, java.nio.ByteBuffer newpath, int flags)
-
io_uring_prep_renameat
public static void io_uring_prep_renameat(IOURingSQE sqe, int olddfd, java.lang.CharSequence oldpath, int newdfd, java.lang.CharSequence newpath, int flags)
-
nio_uring_prep_sync_file_range
public static void nio_uring_prep_sync_file_range(long sqe, int fd, int len, int offset, int flags)
-
io_uring_prep_sync_file_range
public static void io_uring_prep_sync_file_range(IOURingSQE sqe, int fd, int len, int offset, int flags)
-
nio_uring_prep_mkdirat
public static void nio_uring_prep_mkdirat(long sqe, int dfd, long path, int mode)
-
io_uring_prep_mkdirat
public static void io_uring_prep_mkdirat(IOURingSQE sqe, int dfd, java.nio.ByteBuffer path, int mode)
-
io_uring_prep_mkdirat
public static void io_uring_prep_mkdirat(IOURingSQE sqe, int dfd, java.lang.CharSequence path, int mode)
-
nio_uring_prep_symlinkat
public static void nio_uring_prep_symlinkat(long sqe, long target, int newdirfd, long linkpath)
-
io_uring_prep_symlinkat
public static void io_uring_prep_symlinkat(IOURingSQE sqe, java.nio.ByteBuffer target, int newdirfd, java.nio.ByteBuffer linkpath)
-
io_uring_prep_symlinkat
public static void io_uring_prep_symlinkat(IOURingSQE sqe, java.lang.CharSequence target, int newdirfd, java.lang.CharSequence linkpath)
-
nio_uring_prep_linkat
public static void nio_uring_prep_linkat(long sqe, int olddfd, long oldpath, int newdfd, long newpath, int flags)
-
io_uring_prep_linkat
public static void io_uring_prep_linkat(IOURingSQE sqe, int olddfd, java.nio.ByteBuffer oldpath, int newdfd, java.nio.ByteBuffer newpath, int flags)
-
io_uring_prep_linkat
public static void io_uring_prep_linkat(IOURingSQE sqe, int olddfd, java.lang.CharSequence oldpath, int newdfd, java.lang.CharSequence newpath, int flags)
-
nio_uring_sq_ready
public static int nio_uring_sq_ready(long ring)
Unsafe version of:sq_ready
-
io_uring_sq_ready
public static int io_uring_sq_ready(IOURing ring)
Returns the number of unconsumed (ifSQPOLL) or unsubmitted entries that exist in the SQ ring belonging to theringparam.
-
nio_uring_sq_space_left
public static int nio_uring_sq_space_left(long ring)
Unsafe version of:sq_space_left
-
io_uring_sq_space_left
public static int io_uring_sq_space_left(IOURing ring)
Returns how much space is left in the SQ ring belonging to theringparam.
-
nio_uring_sqring_wait
public static int nio_uring_sqring_wait(long ring)
Unsafe version of:sqring_wait
-
io_uring_sqring_wait
public static int io_uring_sqring_wait(IOURing ring)
Allows the caller to wait for space to free up in the SQ ring belonging to theringparam, which happens when the kernel side thread has consumed one or more entries.If the SQ ring is currently non-full, no action is taken.
This feature can only be used when
SQPOLLis enabled.
-
nio_uring_cq_ready
public static int nio_uring_cq_ready(long ring)
Unsafe version of:cq_ready
-
io_uring_cq_ready
public static int io_uring_cq_ready(IOURing ring)
Retuns the number of unconsumed entries that are ready belonging to theringparam.
-
nio_uring_cq_eventfd_enabled
public static boolean nio_uring_cq_eventfd_enabled(long ring)
Unsafe version of:cq_eventfd_enabled
-
io_uring_cq_eventfd_enabled
public static boolean io_uring_cq_eventfd_enabled(IOURing ring)
Returns true if theeventfdnotification is currently enabled.
-
nio_uring_cq_eventfd_toggle
public static int nio_uring_cq_eventfd_toggle(long ring, boolean enabled)Unsafe version of:cq_eventfd_toggle
-
io_uring_cq_eventfd_toggle
public static int io_uring_cq_eventfd_toggle(IOURing ring, boolean enabled)
Toggleeventfdnotification on or off, if aneventfdis registered with the ring.
-
nio_uring_wait_cqe_nr
public static int nio_uring_wait_cqe_nr(long ring, long cqe_ptr, int wait_nr)Unsafe version of:wait_cqe_nr
-
io_uring_wait_cqe_nr
public static int io_uring_wait_cqe_nr(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)
Returnswait_nrIO completion events from the queue belonging to theringparam, waiting for it if necessary. Thecqe_ptrparam is filled in on success.After the caller has submitted a request with
submit, they can retrieve the completion withio_uring_wait_cqe_nr().- Returns:
- 0 on success and the
cqe_ptrparam is filled in. On failure it returns-errno.
-
nio_uring_peek_cqe
public static int nio_uring_peek_cqe(long ring, long cqe_ptr)Unsafe version of:peek_cqe
-
io_uring_peek_cqe
public static int io_uring_peek_cqe(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)
Returns an IO completion, if one is readily available.- Returns:
- 0 with
cqe_ptrfilled in on success,-errnoon failure
-
nio_uring_wait_cqe
public static int nio_uring_wait_cqe(long ring, long cqe_ptr)Unsafe version of:wait_cqe
-
io_uring_wait_cqe
public static int io_uring_wait_cqe(IOURing ring, org.lwjgl.PointerBuffer cqe_ptr)
Returns an IO completion from the queue belonging to theringparam, waiting for it if necessary. Thecqe_ptrparam is filled in on success.After the caller has submitted a request with
submit, they can retrieve the completion withio_uring_wait_cqe().- Returns:
- 0 on success and the
cqe_ptrparam is filled in. On failure it returns-errno.
-
io_uring_mlock_size
public static int io_uring_mlock_size(int entries, int flags)Return requiredulimit -lmemory space for a given ring setup. Seemlock_size_params.- Parameters:
flags-io_uring_paramsflags
-
nio_uring_mlock_size_params
public static int nio_uring_mlock_size_params(int entries, long p)Unsafe version of:mlock_size_params
-
io_uring_mlock_size_params
public static int io_uring_mlock_size_params(int entries, IOURingParams p)Returns the requiredulimit -l memlockmemory required for a given ring setup, in bytes.May return
-errnoon error. On newer (5.12+) kernels,io_uringno longer requires anymemlockmemory, and hence this function will return 0 for that case. On older (5.11 and prior) kernels, this will return the required memory so that the caller can ensure that enough space is available before setting up a ring with the specified parameters.
-
nio_uring_register_buffers_tags
public static int nio_uring_register_buffers_tags(long ring, long iovecs, long[] tags, int nr)Array version of:nio_uring_register_buffers_tags(long, long, long, int)
-
io_uring_register_buffers_tags
public static int io_uring_register_buffers_tags(IOURing ring, IOVec.Buffer iovecs, long[] tags)
Array version of:register_buffers_tags
-
nio_uring_register_buffers_update_tag
public static int nio_uring_register_buffers_update_tag(long ring, int off, long iovecs, long[] tags, int nr)Array version of:nio_uring_register_buffers_update_tag(long, int, long, long, int)
-
io_uring_register_buffers_update_tag
public static int io_uring_register_buffers_update_tag(IOURing ring, int off, IOVec.Buffer iovecs, long[] tags)
Array version of:register_buffers_update_tag
-
nio_uring_register_files
public static int nio_uring_register_files(long ring, int[] files, int nr_files)Array version of:nio_uring_register_files(long, long, int)
-
io_uring_register_files
public static int io_uring_register_files(IOURing ring, int[] files)
Array version of:register_files
-
nio_uring_register_files_tags
public static int nio_uring_register_files_tags(long ring, int[] files, long[] tags, int nr)Array version of:nio_uring_register_files_tags(long, long, long, int)
-
io_uring_register_files_tags
public static int io_uring_register_files_tags(IOURing ring, int[] files, long[] tags)
Array version of:register_files_tags
-
nio_uring_register_files_update_tag
public static int nio_uring_register_files_update_tag(long ring, int off, int[] files, long[] tags, int nr_files)Array version of:nio_uring_register_files_update_tag(long, int, long, long, int)
-
io_uring_register_files_update_tag
public static int io_uring_register_files_update_tag(IOURing ring, int off, int[] files, long[] tags)
Array version of:register_files_update_tag
-
nio_uring_register_files_update
public static int nio_uring_register_files_update(long ring, int off, int[] files, int nr_files)Array version of:nio_uring_register_files_update(long, int, long, int)
-
io_uring_register_files_update
public static int io_uring_register_files_update(IOURing ring, int off, int[] files)
Array version of:register_files_update
-
nio_uring_register_iowq_max_workers
public static int nio_uring_register_iowq_max_workers(long ring, int[] values)Array version of:nio_uring_register_iowq_max_workers(long, long)
-
io_uring_register_iowq_max_workers
public static int io_uring_register_iowq_max_workers(IOURing ring, int[] values)
Array version of:register_iowq_max_workers
-
nio_uring_prep_accept
public static void nio_uring_prep_accept(long sqe, int fd, long addr, int[] addrlen, int flags)Array version of:nio_uring_prep_accept(long, int, long, long, int)
-
io_uring_prep_accept
public static void io_uring_prep_accept(IOURingSQE sqe, int fd, Sockaddr addr, int[] addrlen, int flags)
Array version of:prep_accept
-
nio_uring_prep_accept_direct
public static void nio_uring_prep_accept_direct(long sqe, int fd, long addr, int[] addrlen, int flags, int file_index)Array version of:nio_uring_prep_accept_direct(long, int, long, long, int, int)
-
io_uring_prep_accept_direct
public static void io_uring_prep_accept_direct(IOURingSQE sqe, int fd, Sockaddr addr, int[] addrlen, int flags, int file_index)
Array version of:prep_accept_direct
-
nio_uring_prep_files_update
public static void nio_uring_prep_files_update(long sqe, int[] fds, int nr_fds, int offset)Array version of:nio_uring_prep_files_update(long, long, int, int)
-
io_uring_prep_files_update
public static void io_uring_prep_files_update(IOURingSQE sqe, int[] fds, int offset)
Array version of:prep_files_update
-
-