package core:sys/linux/uring

Warning: This was generated for -target:windows_amd64 and might not represent every target this package supports.

⌘K
Ctrl+K
or
/

    Overview

    Wrapper/convenience package over the raw io_uring syscalls, providing help with setup, creation, and operating the ring.

    The following example shows a simple cat program implementation using the package.

    Example:
    package main
    
    import "base:runtime"
    
    import "core:fmt"
    import "core:os"
    import "core:sys/linux"
    import "core:sys/linux/uring"
    
    Request :: struct {
    	path:       cstring,
    	buffer:     []byte,
    	completion: linux.IO_Uring_CQE,
    }
    
    main :: proc() {
    	if len(os.args) < 2 {
    		fmt.eprintfln("Usage: %s [file name] <[file name] ...>", os.args[0])
    		os.exit(1)
    	}
    
    	requests := make_soa(#soa []Request, len(os.args)-1)
    	defer delete(requests)
    
    	ring: uring.Ring
    	params := uring.DEFAULT_PARAMS
    	err := uring.init(&ring, ¶ms)
    	fmt.assertf(err == nil, "uring.init: %v", err)
    	defer uring.destroy(&ring)
    
    	for &request, i in requests {
    		request.path = runtime.args__[i+1]
    		// sets up a read requests and adds it to the ring buffer.
    		submit_read_request(request.path, &request.buffer, &ring)
    	}
    
    	ulen := u32(len(requests))
    
    	// submit the requests and wait for them to complete right away.
    	n, serr := uring.submit(&ring, ulen)
    	fmt.assertf(serr == nil, "uring.submit: %v", serr)
    	assert(n == ulen)
    
    	// copy the completed requests out of the ring buffer.
    	cn := uring.copy_cqes_ready(&ring, requests.completion[:ulen])
    	assert(cn == ulen)
    
    	for request in requests {
    		// check result of the requests.
    		fmt.assertf(request.completion.res >= 0, "read %q failed: %v", request.path, linux.Errno(-request.completion.res))
    		// print out.
    		fmt.print(string(request.buffer))
    
    		delete(request.buffer)
    	}
    }
    
    submit_read_request :: proc(path: cstring, buffer: ^[]byte, ring: ^uring.Ring) {
    	fd, err := linux.open(path, {})
    	fmt.assertf(err == nil, "open(%q): %v", path, err)
    
    	file_sz := get_file_size(fd)
    
    	buffer^ = make([]byte, file_sz)
    
    	_, ok := uring.read(ring, 0, fd, buffer^, 0)
    	assert(ok, "could not get read sqe")
    }
    
    get_file_size :: proc(fd: linux.Fd) -> uint {
    	st: linux.Stat
    	err := linux.fstat(fd, &st)
    	fmt.assertf(err == nil, "fstat: %v", err)
    
    	if linux.S_ISREG(st.mode) {
    		return uint(st.size)
    	}
    
    	panic("not a regular file")
    }
    

    Types

    Completion_Queue ¶

    Completion_Queue :: struct {
    	head:     ^u32,
    	tail:     ^u32,
    	mask:     u32,
    	overflow: ^u32,
    	cqes:     []linux.IO_Uring_CQE,
    }
    Related Procedures With Returns

    Submission_Queue ¶

    Submission_Queue :: struct {
    	head:      ^u32,
    	tail:      ^u32,
    	mask:      u32,
    	flags:     ^bit_set[linux.IO_Uring_Submission_Queue_Flags_Bits; u32],
    	dropped:   ^u32,
    	array:     []u32,
    	sqes:      []linux.IO_Uring_SQE,
    	mmap:      []u8,
    	mmap_sqes: []u8,
    	// We use `sqe_head` and `sqe_tail` in the same way as liburing:
    	// We increment `sqe_tail` (but not `tail`) for each call to `get_sqe()`.
    	// We then set `tail` to `sqe_tail` once, only when these events are actually submitted.
    	// This allows us to amortize the cost of the @atomicStore to `tail` across multiple SQEs.
    	sqe_head:  u32,
    	sqe_tail:  u32,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    DEFAULT_ENTRIES ¶

    DEFAULT_ENTRIES: int : 32

    DEFAULT_PARAMS ¶

    DEFAULT_PARAMS: linux.IO_Uring_Params : linux.IO_Uring_Params{sq_thread_idle = DEFAULT_THREAD_IDLE_MS}

    DEFAULT_THREAD_IDLE_MS ¶

    DEFAULT_THREAD_IDLE_MS: int : 1000

    MAX_ENTRIES ¶

    MAX_ENTRIES: int : 4096

    Variables

    This section is empty.

    Procedures

    accept ¶

    accept :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	sockfd:     linux.Fd, 
    	addr:       ^$T, 
    	addr_len:   ^i32, 
    	flags:      bit_set[linux.Socket_FD_Flags_Bits; i32], 
    	file_index: u32 = 0, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of an accept4(2) system call.

    See also accept4(2) for the general description of the related system call.

    If the file_index field is set to a positive number, the file won't be installed into the normal file table as usual but will be placed into the fixed file table at index file_index - 1. In this case, instead of returning a file descriptor, the result will contain either 0 on success or an error. If the index points to a valid empty slot, the installation is guaranteed to not fail. If there is already a file in the slot, it will be replaced, similar to IORING_OP_FILES_UPDATE. Please note that only uring has access to such files and no other syscall can use them. See IOSQE_FIXED_FILE and IORING_REGISTER_FILES.

    Available since 5.5.

    async_cancel ¶

    async_cancel :: proc(ring: ^Ring, orig_user_data: u64, user_data: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Attempt to cancel an already issued request.

    The request is identified by it's user data.

    The cancelation request will complete with one of the following results codes.

    If found, the res field of the cqe will contain 0. If not found, res will contain -ENOENT.

    If found and attempted canceled, the res field will contain -EALREADY. In this case, the request may or may not terminate. In general, requests that are interruptible (like socket IO) will get canceled, while disk IO requests cannot be canceled if already started.

    Available since 5.5.

    bind ¶

    bind :: proc(ring: ^Ring, user_data: u64, sock: linux.Fd, addr: ^$T) -> (sqe: linux.IO_Uring_SQE, ok: bool) {…}
     

    Issues the equivalent of the bind(2) system call.

    Available since 6.11.

    close ¶

    close :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, file_index: u32 = 0) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a close(2) system call.

    See also close(2) for the general description of the related system call.

    Available since 5.6.

    If the file_index field is set to a positive number, this command can be used to close files that were direct opened through IORING_OP_OPENAT, IORING_OP_OPENAT2, or IORING_OP_ACCEPT using the uring specific direct descriptors. Note that only one of the descriptor fields may be set. The direct close feature is available since the 5.15 kernel, where direct descriptors were introduced.

    completion_queue_make ¶

    completion_queue_make :: proc(fd: linux.Fd, params: ^linux.IO_Uring_Params, sq: ^Submission_Queue) -> Completion_Queue {…}

    connect ¶

    connect :: proc(ring: ^Ring, user_data: u64, sockfd: linux.Fd, addr: ^$T) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a connect(2) system call.

    See also connect(2) for the general description of the related system call.

    Available since 5.5.

    copy_cqes ¶

    copy_cqes :: proc(ring: ^Ring, cqes: []linux.IO_Uring_CQE, wait_nr: u32) -> (n_copied: u32, err: linux.Errno) {…}
     

    Copies as many CQEs as are ready, and that can fit into the destination cqes slice. If none are available, enters into the kernel to wait for at most wait_nr CQEs. Returns the number of CQEs copied, advancing the CQ ring. Provides all the wait/peek methods found in liburing, but with batching and a single method. TODO: allow for timeout.

    copy_cqes_ready ¶

    copy_cqes_ready :: proc(ring: ^Ring, cqes: []linux.IO_Uring_CQE) -> (n_copied: u32) {…}

    cq_advance ¶

    cq_advance :: proc(ring: ^Ring, count: u32) {…}
     

    For advanced use cases only that implement custom completion queue methods. Matches the implementation of cq_advance() in liburing.

    cq_ready ¶

    cq_ready :: proc(ring: ^Ring) -> (n_ready: u32) {…}
     

    Returns the number of completion queue entries in the completion queue (yet to consume).

    cq_ring_needs_flush ¶

    cq_ring_needs_flush :: proc(ring: ^Ring) -> bool {…}

    cqe_seen ¶

    cqe_seen :: proc(ring: ^Ring) {…}
     

    For advanced use cases only that implement custom completion queue methods. If you use copy_cqes() or copy_cqe() you must not call cqe_seen() or cq_advance(). Must be called exactly once after a zero-copy CQE has been processed by your application. Not idempotent, calling more than once will result in other CQEs being lost. Matches the implementation of cqe_seen() in liburing.

    destroy ¶

    destroy :: proc(ring: ^Ring) {…}

    epoll_ctl ¶

    epoll_ctl :: proc(
    	ring:      ^Ring, 
    	user_data: u64, 
    	epfd:      linux.Fd, 
    	op:        linux.EPoll_Ctl_Opcode, 
    	fd:        linux.Fd, 
    	event:     ^linux.EPoll_Event, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Add, remove or modify entries in the interest list of epoll(7).

    See epoll_ctl(2) for details of the system call.

    Available since 5.6.

    fadvise ¶

    fadvise :: proc() {…}

    fallocate ¶

    fallocate :: proc() {…}

    fgetxattr ¶

    fgetxattr :: proc() {…}

    files_update ¶

    files_update :: proc(ring: ^Ring, user_data: u64, fds: []linux.Fd, off: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    This command is an alternative to using IORING_REGISTER_FILES_UPDATE which then works in an async fashion, like the rest of the uring commands.

    Note that the array of file descriptors pointed to in addr must remain valid until this operation has completed.

    Available since 5.6.

    fixed_fd_install ¶

    fixed_fd_install :: proc() {…}

    fixed_file ¶

    fixed_file :: proc() {…}

    flush_sq ¶

    flush_sq :: proc(ring: ^Ring) -> (n_pending: u32) {…}
     

    Sync internal state with kernel ring state on the submission queue side. Returns the number of all pending events in the submission queue. Rationale is to determine that an enter call is needed.

    free_space ¶

    free_space :: proc(ring: ^Ring) -> int {…}

    fsetxattr ¶

    fsetxattr :: proc() {…}

    fsync ¶

    fsync :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, flags: bit_set[linux.IO_Uring_Fsync_Flags_Bits; u32]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    File sync. See also fsync(2).

    Optionally off and len can be used to specify a range within the file to be synced rather than syncing the entire file, which is the default behavior.

    Note that, while I/O is initiated in the order in which it appears in the submission queue, completions are unordered. For example, an application which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write. The two operations execute in parallel, so the fsync may complete before the write is issued to the storage. The same is also true for previously issued writes that have not completed prior to the fsync. To enforce ordering one may utilize linked SQEs, IOSQE_IO_DRAIN or wait for the arrival of CQEs of requests which have to be ordered before a given request before submitting its SQE.

    ftruncate ¶

    ftruncate :: proc() {…}

    futex_wait ¶

    futex_wait :: proc() {…}

    futex_waitv ¶

    futex_waitv :: proc() {…}

    futex_wake ¶

    futex_wake :: proc() {…}

    get_sqe ¶

    get_sqe :: proc(ring: ^Ring, extra: int = 1) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Returns a pointer to a vacant submission queue entry, or nil if the submission queue is full. NOTE: extra is so you can make sure there is space for related entries, defaults to 1 so a link timeout op can always be added after another.

    getxattr ¶

    getxattr :: proc() {…}

    init ¶

    init :: proc(ring: ^Ring, params: ^linux.IO_Uring_Params, entries: u32 = DEFAULT_ENTRIES) -> (err: linux.Errno) {…}
     

    Initialize and setup an uring, entries must be a power of 2 between 1 and 4096.

    link_timeout :: proc(ring: ^Ring, user_data: u64, ts: ^linux.Time_Spec, flags: bit_set[linux.IO_Uring_Timeout_Flags_Bits; u32]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Adds a link timeout operation.

    You need to set linux.IOSQE_IO_LINK to flags of the target operation and then call this method right after the target operation. See https://lwn.net/Articles/803932/ for detail.

    If the dependent request finishes before the linked timeout, the timeout is canceled. If the timeout finishes before the dependent request, the dependent request will be canceled.

    The completion event result of the link_timeout will be -ETIME if the timeout finishes before the dependent request (in this case, the completion event result of the dependent request will be -ECANCELED), or -EALREADY if the dependent request finishes before the linked timeout.

    Available since 5.5.

    linkat ¶

    linkat :: proc() {…}

    listen ¶

    listen :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, backlog: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issues the equivalent of the listen(2) system call.

    fd must contain the file descriptor of the socket and addr must contain the backlog parameter, i.e. the maximum amount of pending queued connections.

    Available since 6.11.

    madvise ¶

    madvise :: proc(ring: ^Ring, user_data: u64, addr: rawptr, size: u32, advise: linux.MAdvice) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a madvise(2) system call.

    See also madvise(2) for the general description of the related system call.

    Available since 5.6.

    mkdirat ¶

    mkdirat :: proc() {…}

    msg_ring ¶

    msg_ring :: proc() {…}

    nop ¶

    nop :: proc(ring: ^Ring, user_data: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Do not perform any I/O. This is useful for testing the performance of the uring implementation itself.

    openat ¶

    openat :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	dirfd:      linux.Fd, 
    	path:       cstring, 
    	mode:       bit_set[linux.Mode_Bits; u32], 
    	flags:      bit_set[linux.Open_Flags_Bits; u32], 
    	file_index: u32 = 0, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a openat(2) system call.

    See also openat(2) for the general description of the related system call.

    Available since 5.6.

    If the file_index is set to a positive number, the file won't be installed into the normal file table as usual but will be placed into the fixed file table at index file_index - 1. In this case, instead of returning a file descriptor, the result will contain either 0 on success or an error. If the index points to a valid empty slot, the installation is guaranteed to not fail. If there is already a file in the slot, it will be replaced, similar to IORING_OP_FILES_UPDATE. Please note that only uring has access to such files and no other syscall can use them. See IOSQE_FIXED_FILE and IORING_REGISTER_FILES.

    Available since 5.15.

    openat2 ¶

    openat2 :: proc() {…}

    poll_add ¶

    poll_add :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, events: bit_set[linux.Fd_Poll_Events_Bits; u16], flags: bit_set[linux.IO_Uring_Poll_Add_Flags_Bits; u32]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Poll the fd specified in the submission queue entry for the events specified in the poll_events field.

    Unlike poll or epoll without EPOLLONESHOT, by default this interface always works in one shot mode. That is, once the poll operation is completed, it will have to be resubmitted.

    If IORING_POLL_ADD_MULTI is set in the SQE len field, then the poll will work in multi shot mode instead. That means it'll repatedly trigger when the requested event becomes true, and hence multiple CQEs can be generated from this single SQE. The CQE flags field will have IORING_CQE_F_MORE set on completion if the application should expect further CQE entries from the original request. If this flag isn't set on completion, then the poll request has been terminated and no further events will be generated. This mode is available since 5.13.

    This command works like an async poll(2) and the completion event result is the returned mask of events.

    Without IORING_POLL_ADD_MULTI and the initial poll operation with IORING_POLL_ADD_MULTI the operation is level triggered, i.e. if there is data ready or events pending etc. at the time of submission a corresponding CQE will be posted. Potential further completions beyond the first caused by a IORING_POLL_ADD_MULTI are edge triggered.

    poll_remove ¶

    poll_remove :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, events: bit_set[linux.Fd_Poll_Events_Bits; u16]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Remove an existing poll request.

    If found, the res field of the struct io_uring_cqe will contain 0. If not found, res will contain -ENOENT, or -EALREADY if the poll request was in the process of completing already.

    poll_update_events ¶

    poll_update_events :: proc(ring: ^Ring, user_data: u64, orig_user_data: u64, fd: linux.Fd, events: bit_set[linux.Fd_Poll_Events_Bits; u16]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Update the events of an existing poll request.

    The request will update an existing poll request with the mask of events passed in with this request. The lookup is based on the user_data field of the original SQE submitted.

    Updating an existing poll is available since 5.13.

    poll_update_user_data ¶

    poll_update_user_data :: proc(ring: ^Ring, user_data: u64, orig_user_data: u64, new_user_data: u64, fd: linux.Fd) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Update the user data of an existing poll request.

    The request will update the user_data of an existing poll request based on the value passed.

    Updating an existing poll is available since 5.13.

    provide_buffers ¶

    provide_buffers :: proc() {…}

    read ¶

    read :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, buf: []u8, offset: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a pread(2) system call.

    If offset is set to -1 , the offset will use (and advance) the file position, like the read(2) system calls. These are non-vectored versions of the IORING_OP_READV and IORING_OP_WRITEV opcodes. See also read(2) for the general description of the related system call.

    Available since 5.6.

    read_fixed ¶

    read_fixed :: proc() {…}

    read_multishot ¶

    read_multishot :: proc() {…}

    readv ¶

    readv :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, iovs: []linux.IO_Vec, off: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Vectored read operation, see also readv(2).

    recv ¶

    recv :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	sockfd:     linux.Fd, 
    	buf:        []u8, 
    	flags:      bit_set[linux.Socket_Msg_Bits; i32], 
    	poll_first: bool = false, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Works just like send, but receives instead of sends.

    poll_first: If set, uring will assume the socket is currently empty and attempting to receive data will be unsuccessful. For this case, uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to arming poll. If poll does indicate that data is ready to be received, the operation will proceed.

    Available since 5.6.

    recvmsg ¶

    recvmsg :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	fd:         linux.Fd, 
    	msghdr:     ^linux.Msg_Hdr, 
    	flags:      bit_set[linux.Socket_Msg_Bits; i32], 
    	poll_first: bool = false, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Works just like sendmsg, but receives instead of sends.

    poll_first: If set, uring will assume the socket is currently empty and attempting to receive data will be unsuccessful. For this case, uring will arm internal poll and trigger a receive of the data when the socket has data to be read. This initial receive attempt can be wasteful for the case where the socket is expected to be empty, setting this flag will bypass the initial receive attempt and go straight to arming poll. If poll does indicate that data is ready to be received, the operation will proceed.

    Available since 5.3.

    remove_buffers ¶

    remove_buffers :: proc() {…}

    renameat ¶

    renameat :: proc() {…}

    send ¶

    send :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	sockfd:     linux.Fd, 
    	buf:        []u8, 
    	flags:      bit_set[linux.Socket_Msg_Bits; i32], 
    	poll_first: bool = false, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a send(2) system call.

    See also send(2) for the general description of the related system call.

    poll_first: If set, uring will assume the socket is currently full and attempting to send data will be unsuccessful. For this case, uring will arm internal poll and trigger a send of the data when there is enough space available. This initial send attempt can be wasteful for the case where the socket is expected to be full, setting this flag will bypass the initial send attempt and go straight to arming poll. If poll does indicate that data can be sent, the operation will proceed.

    Available since 5.6.

    send_zc ¶

    send_zc :: proc() {…}

    sendmsg ¶

    sendmsg :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	fd:         linux.Fd, 
    	msghdr:     ^linux.Msg_Hdr, 
    	flags:      bit_set[linux.Socket_Msg_Bits; i32], 
    	poll_first: bool = false, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a sendmsg(2) system call.

    See also sendmsg(2) for the general description of the related system call.

    poll_first: if set, uring will assume the socket is currently full and attempting to send data will be unsuccessful. For this case, uring will arm internal poll and trigger a send of the data when there is enough space available. This initial send attempt can be wasteful for the case where the socket is expected to be full, setting this flag will bypass the initial send attempt and go straight to arming poll. If poll does indicate that data can be sent, the operation will proceed.

    Available since 5.3.

    sendmsg_zc ¶

    sendmsg_zc :: proc() {…}

    sendto ¶

    sendto :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	sockfd:     linux.Fd, 
    	buf:        []u8, 
    	flags:      bit_set[linux.Socket_Msg_Bits; i32], 
    	dest:       ^$T, 
    	poll_first: bool = false, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}

    setxattr ¶

    setxattr :: proc() {…}

    shutdown ¶

    shutdown :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, how: linux.Shutdown_How) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a shutdown(2) system call.

    Available since 5.11.

    socket ¶

    socket :: proc(
    	ring:       ^Ring, 
    	user_data:  u64, 
    	domain:     linux.Address_Family, 
    	socktype:   linux.Socket_Type, 
    	protocol:   linux.Protocol, 
    	file_index: u32 = 0, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a socket(2) system call.

    See also socket(2) for the general description of the related system call.

    Available since 5.19.

    If the file_index field is set to a positive number, the file won't be installed into the normal file table as usual but will be placed into the fixed file table at index file_index - 1. In this case, instead of returning a file descriptor, the result will contain either 0 on success or an error. If the index points to a valid empty slot, the installation is guaranteed to not fail. If there is already a file in the slot, it will be replaced, similar to IORING_OP_FILES_UPDATE. Please note that only uring has access to such files and no other syscall can use them. See IOSQE_FIXED_FILE and IORING_REGISTER_FILES.

    splice ¶

    splice :: proc(
    	ring:      ^Ring, 
    	user_data: u64, 
    	fd_in:     linux.Fd, 
    	off_in:    i64, 
    	fd_out:    linux.Fd, 
    	off_out:   i64, 
    	len:       u32, 
    	flags:     bit_set[linux.IO_Uring_Splice_Flags_Bits; u32], 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a splice(2) system call.

    A sentinel value of -1 is used to pass the equivalent of a NULL for the offsets to splice(2).

    Please note that one of the file descriptors must refer to a pipe. See also splice(2) for the general description of the related system call.

    Available since 5.7.

    sq_ready ¶

    sq_ready :: proc(ring: ^Ring) -> u32 {…}
     

    Returns the number of submission queue entries in the submission queue.

    sq_ring_needs_enter ¶

    sq_ring_needs_enter :: proc(ring: ^Ring, flags: ^bit_set[linux.IO_Uring_Enter_Flags_Bits; u32]) -> bool {…}
     

    Returns true if we are not using an SQ thread (thus nobody submits but us), or if IORING_SQ_NEED_WAKEUP is set and the SQ thread must be explicitly awakened. For the latter case, we set the SQ thread wakeup flag. Matches the implementation of sq_ring_needs_enter() in liburing.

    statx ¶

    statx :: proc(
    	ring:      ^Ring, 
    	user_data: u64, 
    	dirfd:     linux.Fd, 
    	pathname:  cstring, 
    	flags:     bit_set[linux.FD_Flags_Bits; i32], 
    	mask:      bit_set[linux.Statx_Mask_Bits; u32], 
    	buf:       ^linux.Statx, 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a statx(2) system call.

    See also statx(2) for the general description of the related system call.

    Available since 5.6.

    submission_queue_destroy ¶

    submission_queue_destroy :: proc(sq: ^Submission_Queue) -> (err: linux.Errno) {…}

    submission_queue_make ¶

    submission_queue_make :: proc(fd: linux.Fd, params: ^linux.IO_Uring_Params) -> (sq: Submission_Queue, err: linux.Errno) {…}

    submit ¶

    submit :: proc(ring: ^Ring, wait_nr: u32 = 0, timeout: ^linux.Time_Spec = nil) -> (n_submitted: u32, err: linux.Errno) {…}
     

    Submits the submission queue entries acquired via get_sqe(). Returns the number of entries submitted. Optionally wait for a number of events by setting wait_nr, and/or set a maximum wait time by setting timeout.

    symlinkat ¶

    symlinkat :: proc() {…}

    sync_file_range ¶

    sync_file_range :: proc() {…}

    tee ¶

    tee :: proc(
    	ring:      ^Ring, 
    	user_data: u64, 
    	fd_in:     linux.Fd, 
    	fd_out:    linux.Fd, 
    	len:       u32, 
    	flags:     bit_set[linux.IO_Uring_Splice_Flags_Bits; u32], 
    ) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a tee(2) system call.

    Please note that both of the file descriptors must refer to a pipe. See also tee(2) for the general description of the related system call.

    Available since 5.8.

    timeout ¶

    timeout :: proc(ring: ^Ring, user_data: u64, ts: ^linux.Time_Spec, count: u32, flags: bit_set[linux.IO_Uring_Timeout_Flags_Bits; u32]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Register a timeout operation.

    The timeout will complete when either the timeout expires, or after the specified number of events complete (if count is greater than 0).

    flags may be 0 for a relative timeout, or IORING_TIMEOUT_ABS for an absolute timeout.

    The completion event result will be -ETIME if the timeout completed through expiration, 0 if the timeout completed after the specified number of events, or -ECANCELED if the timeout was removed before it expired.

    uring timeouts use the CLOCK.MONOTONIC clock source.

    timeout_remove ¶

    timeout_remove :: proc(ring: ^Ring, user_data: u64, timeout_user_data: u64, flags: bit_set[linux.IO_Uring_Timeout_Flags_Bits; u32]) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Rmove an existing timeout operation.

    The timeout is identified by it's user_data.

    The completion event result will be 0 if the timeout was found and cancelled successfully, -EBUSY if the timeout was found but expiration was already in progress, or -ENOENT if the timeout was not found.

    unlinkat ¶

    unlinkat :: proc() {…}

    uring_cmd ¶

    uring_cmd :: proc() {…}

    waitid ¶

    waitid :: proc() {…}

    write ¶

    write :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, buf: []u8, offset: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Issue the equivalent of a pwrite(2) system call.

    If offset is set to -1 , the offset will use (and advance) the file position, like the read(2) system calls. These are non-vectored versions of the IORING_OP_READV and IORING_OP_WRITEV opcodes. See also write(2) for the general description of the related system call.

    Available since 5.6.

    write_fixed ¶

    write_fixed :: proc() {…}

    writev ¶

    writev :: proc(ring: ^Ring, user_data: u64, fd: linux.Fd, iovs: []linux.IO_Vec, off: u64) -> (sqe: ^linux.IO_Uring_SQE, ok: bool) {…}
     

    Vectored write operation, see also writev(2).

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2026-01 (vendor "odin") Windows_amd64 @ 2026-01-16 21:15:00.298404200 +0000 UTC