pub fn accept(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: ?*posix.sockaddr, addrlen: ?*posix.socklen_t, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `accept4(2)` on a socket.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn accept_direct(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: ?*posix.sockaddr, addrlen: ?*posix.socklen_t, flags: u32) !*linux.io_uring_sqe
Queues an accept using direct (registered) file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn accept_multishot(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: ?*posix.sockaddr, addrlen: ?*posix.socklen_t, flags: u32) !*linux.io_uring_sqe
Queues an multishot accept on a socket.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn accept_multishot_direct(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: ?*posix.sockaddr, addrlen: ?*posix.socklen_t, flags: u32) !*linux.io_uring_sqe
Queues an multishot accept using direct (registered) file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn bind(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: *const posix.sockaddr, addrlen: posix.socklen_t, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `bind(2)` on a socket.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn buf_ring_add(br: *linux.io_uring_buf_ring, buffer: []u8, buffer_id: u16, mask: u16, buffer_offset: u16) void
Assigns `buffer` with the `br` buffer ring. `buffer_id` is identifier which will be returned in the CQE. `buffer_offset` is the offset to insert at from the current tail.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn buf_ring_advance(br: *linux.io_uring_buf_ring, count: u16) void
Make `count` new buffers visible to the kernel.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn buf_ring_init(br: *linux.io_uring_buf_ring) void
Initialises `br` so that it is ready to be used.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn buf_ring_mask(entries: u16) u16
Calculates the appropriate size mask for a buffer ring. `entries` is the ring entries as specified in io_uring_register_buf_ring.
- Kind
- function
- Module
std.os.linux.IoUring
Group of application provided buffers.
- Kind
- struct
- Module
std.os.linux.IoUring
pub fn deinit(self: *BufferGroup, allocator: Allocator) void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn get(self: *BufferGroup, cqe: linux.io_uring_cqe) ![]u8
- Kind
- function
- Module
std.os.linux.IoUring
pub fn get_by_id(self: *BufferGroup, buffer_id: u16) []u8
- Kind
- function
- Module
std.os.linux.IoUring
pub fn init(ring: *IoUring, allocator: Allocator, group_id: u16, buffer_size: u32, buffers_count: u16) !BufferGroup
- Kind
- function
- Module
std.os.linux.IoUring
pub fn put(self: *BufferGroup, cqe: linux.io_uring_cqe) !void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn recv(self: *BufferGroup, user_data: u64, fd: linux.fd_t, flags: u32) !*linux.io_uring_sqe
- Kind
- function
- Module
std.os.linux.IoUring
pub fn recv_multishot(self: *BufferGroup, user_data: u64, fd: linux.fd_t, flags: u32) !*linux.io_uring_sqe
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cancel(self: *IoUring, user_data: u64, cancel_user_data: u64, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to remove an existing operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn close(self: *IoUring, user_data: u64, fd: linux.fd_t) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `close(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn close_direct(self: *IoUring, user_data: u64, file_index: u32) !*linux.io_uring_sqe
Queues close of registered file descriptor.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cmd_sock(self: *IoUring, user_data: u64, cmd_op: linux.IO_URING_SOCKET_OP, fd: linux.fd_t, level: u32, optname: u32, optval: u64, optlen: u32) !*linux.io_uring_sqe
Prepares an cmd request for a socket.
- Kind
- function
- Module
std.os.linux.IoUring
- Kind
- struct
- Module
std.os.linux.IoUring
pub fn deinit(self: *CompletionQueue) void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn init(fd: linux.fd_t, p: linux.io_uring_params, sq: SubmissionQueue) !CompletionQueue
- Kind
- function
- Module
std.os.linux.IoUring
pub fn connect(self: *IoUring, user_data: u64, fd: linux.fd_t, addr: *const posix.sockaddr, addrlen: posix.socklen_t) !*linux.io_uring_sqe
Queue (but does not submit) an SQE to perform a `connect(2)` on a socket.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn copy_cqe(ring: *IoUring) !linux.io_uring_cqe
Returns a copy of an I/O completion, waiting for it if necessary, and advancing the CQ ring.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn copy_cqes(self: *IoUring, cqes: []linux.io_uring_cqe, wait_nr: u32) !u32
Copies as many CQEs as are ready, and that can fit into the destination `cqes` slice.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cq_advance(self: *IoUring, count: u32) void
For advanced use cases only that implement custom completion queue methods.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cq_ready(self: *IoUring) u32
Returns the number of CQEs in the completion queue, i.e. its length.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cq_ring_needs_flush(self: *IoUring) bool
Matches the implementation of cq_ring_needs_flush() in liburing.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn cqe_seen(self: *IoUring, cqe: *linux.io_uring_cqe) void
For advanced use cases only that implement custom completion queue methods.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn deinit(self: *IoUring) void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn enter(self: *IoUring, to_submit: u32, min_complete: u32, flags: u32) !u32
Tell the kernel we have submitted SQEs and/or want to wait for CQEs.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn epoll_ctl(self: *IoUring, user_data: u64, epfd: linux.fd_t, fd: linux.fd_t, op: u32, ev: ?*linux.epoll_event) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `epoll_ctl(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn fallocate(self: *IoUring, user_data: u64, fd: linux.fd_t, mode: i32, offset: u64, len: u64) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `fallocate(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn flush_sq(self: *IoUring) u32
Sync internal state with kernel ring state on the SQ side.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn free_buf_ring(fd: linux.fd_t, br: *align(page_size_min) linux.io_uring_buf_ring, entries: u32, group_id: u16) void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn fsync(self: *IoUring, user_data: u64, fd: linux.fd_t, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `fsync(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn get_probe(self: *IoUring) !linux.io_uring_probe
Returns a io_uring_probe which is used to probe the capabilities of the io_uring subsystem of the running kernel.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn get_sqe(self: *IoUring) !*linux.io_uring_sqe
Returns a pointer to a vacant SQE, or an error if the submission queue is full.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn getsockopt(self: *IoUring, user_data: u64, fd: linux.fd_t, level: u32, optname: u32, opt: []u8) !*linux.io_uring_sqe
Prepares get socket option to retrieve the value for the option specified by the option_name argument for the socket specified by the fd argument.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn init(entries: u16, flags: u32) !IoUring
- Kind
- function
- Module
std.os.linux.IoUring
pub fn init_params(entries: u16, p: *linux.io_uring_params) !IoUring
- Kind
- function
- Module
std.os.linux.IoUring
pub fn link_timeout(self: *IoUring, user_data: u64, ts: *const linux.kernel_timespec, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to add a link timeout operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn linkat(self: *IoUring, user_data: u64, old_dir_fd: linux.fd_t, old_path: [*:0]const u8, new_dir_fd: linux.fd_t, new_path: [*:0]const u8, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `linkat(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn listen(self: *IoUring, user_data: u64, fd: linux.fd_t, backlog: usize, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `listen(2)` on a socket.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn mkdirat(self: *IoUring, user_data: u64, dir_fd: linux.fd_t, path: [*:0]const u8, mode: posix.mode_t) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `mkdirat(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn nop(self: *IoUring, user_data: u64) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a no-op.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn openat(self: *IoUring, user_data: u64, fd: linux.fd_t, path: [*:0]const u8, flags: linux.O, mode: posix.mode_t) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `openat(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn openat_direct(self: *IoUring, user_data: u64, fd: linux.fd_t, path: [*:0]const u8, flags: linux.O, mode: posix.mode_t, file_index: u32) !*linux.io_uring_sqe
Queues an openat using direct (registered) file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn poll_add(self: *IoUring, user_data: u64, fd: linux.fd_t, poll_mask: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `poll(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn poll_remove(self: *IoUring, user_data: u64, target_user_data: u64) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to remove an existing poll operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn poll_update(self: *IoUring, user_data: u64, old_user_data: u64, new_user_data: u64, poll_mask: u32, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to update the user data of an existing poll operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn provide_buffers(self: *IoUring, user_data: u64, buffers: [*]u8, buffer_size: usize, buffers_count: usize, group_id: usize, buffer_id: usize) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to provide a group of buffers used for commands that read/receive data.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn read(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: ReadBuffer, offset: u64) !*linux.io_uring_sqe
- Kind
- function
- Module
std.os.linux.IoUring
pub fn read_fixed(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: *posix.iovec, offset: u64, buffer_index: u16) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a IORING_OP_READ_FIXED. The `buffer` provided must be registered with the kernel by calling `register_buffers` first.
- Kind
- function
- Module
std.os.linux.IoUring
Used to select how the read should be handled.
- Kind
- union
- Module
std.os.linux.IoUring
pub fn recv(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: RecvBuffer, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `recv(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
Used to select how the recv call should be handled.
- Kind
- union
- Module
std.os.linux.IoUring
pub fn recvmsg(self: *IoUring, user_data: u64, fd: linux.fd_t, msg: *linux.msghdr, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `recvmsg(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_buffers(self: *IoUring, buffers: []const posix.iovec) !void
Registers an array of buffers for use with `read_fixed` and `write_fixed`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_eventfd(self: *IoUring, fd: linux.fd_t) !void
Registers the file descriptor for an eventfd that will be notified of completion events on an io_uring instance.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_eventfd_async(self: *IoUring, fd: linux.fd_t) !void
Registers the file descriptor for an eventfd that will be notified of completion events on an io_uring instance.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_file_alloc_range(self: *IoUring, offset: u32, len: u32) !void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_files(self: *IoUring, fds: []const linux.fd_t) !void
Registers an array of file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_files_sparse(self: *IoUring, nr_files: u32) !void
Registers an empty (-1) file table of `nr_files` number of file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_files_update(self: *IoUring, offset: u32, fds: []const linux.fd_t) !void
Updates registered file descriptors.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn register_napi(self: *IoUring, napi: *linux.io_uring_napi) !void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn remove_buffers(self: *IoUring, user_data: u64, buffers_count: usize, group_id: usize) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to remove a group of provided buffers.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn renameat(self: *IoUring, user_data: u64, old_dir_fd: linux.fd_t, old_path: [*:0]const u8, new_dir_fd: linux.fd_t, new_path: [*:0]const u8, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `renameat2(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn send(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: []const u8, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `send(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn send_zc(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: []const u8, send_flags: u32, zc_flags: u16) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an async zerocopy `send(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn send_zc_fixed(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: []const u8, send_flags: u32, zc_flags: u16, buf_index: u16) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an async zerocopy `send(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn sendmsg(self: *IoUring, user_data: u64, fd: linux.fd_t, msg: *const linux.msghdr_const, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `sendmsg(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn sendmsg_zc(self: *IoUring, user_data: u64, fd: linux.fd_t, msg: *const linux.msghdr_const, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an async zerocopy `sendmsg(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn setsockopt(self: *IoUring, user_data: u64, fd: linux.fd_t, level: u32, optname: u32, opt: []const u8) !*linux.io_uring_sqe
Prepares set socket option for the optname argument, at the protocol level specified by the level argument.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn setup_buf_ring(fd: linux.fd_t, entries: u16, group_id: u16, flags: linux.io_uring_buf_reg.Flags) !*align(page_size_min) linux.io_uring_buf_ring
- Kind
- function
- Module
std.os.linux.IoUring
pub fn shutdown(self: *IoUring, user_data: u64, sockfd: posix.socket_t, how: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `shutdown(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn socket(self: *IoUring, user_data: u64, domain: u32, socket_type: u32, protocol: u32, flags: u32) !*linux.io_uring_sqe
Prepares a socket creation request.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn socket_direct(self: *IoUring, user_data: u64, domain: u32, socket_type: u32, protocol: u32, flags: u32, file_index: u32) !*linux.io_uring_sqe
Prepares a socket creation request for registered file at index `file_index`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn socket_direct_alloc(self: *IoUring, user_data: u64, domain: u32, socket_type: u32, protocol: u32, flags: u32) !*linux.io_uring_sqe
Prepares a socket creation request for registered file, index chosen by kernel (file index alloc).
- Kind
- function
- Module
std.os.linux.IoUring
pub fn splice(self: *IoUring, user_data: u64, fd_in: linux.fd_t, off_in: u64, fd_out: linux.fd_t, off_out: u64, len: usize) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `splice(2)` Either `fd_in` or `fd_out` must be a pipe.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn sq_ready(self: *IoUring) u32
Returns the number of flushed and unflushed SQEs pending in the submission queue.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn sq_ring_needs_enter(self: *IoUring, flags: *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.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn statx(self: *IoUring, user_data: u64, fd: linux.fd_t, path: [:0]const u8, flags: u32, mask: linux.STATX, buf: *linux.Statx) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform an `statx(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
- Kind
- struct
- Module
std.os.linux.IoUring
pub fn deinit(self: *SubmissionQueue) void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn init(fd: linux.fd_t, p: linux.io_uring_params) !SubmissionQueue
- Kind
- function
- Module
std.os.linux.IoUring
pub fn submit(self: *IoUring) !u32
Submits the SQEs acquired via get_sqe() to the kernel.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn submit_and_wait(self: *IoUring, wait_nr: u32) !u32
Like submit(), but allows waiting for events as well.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn symlinkat(self: *IoUring, user_data: u64, target: [*:0]const u8, new_dir_fd: linux.fd_t, link_path: [*:0]const u8) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `symlinkat(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn timeout(self: *IoUring, user_data: u64, ts: *const linux.kernel_timespec, count: u32, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to register a timeout operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn timeout_remove(self: *IoUring, user_data: u64, timeout_user_data: u64, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to remove an existing timeout operation.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn unlinkat(self: *IoUring, user_data: u64, dir_fd: linux.fd_t, path: [*:0]const u8, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `unlinkat(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn unregister_buffers(self: *IoUring) !void
Unregister the registered buffers.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn unregister_eventfd(self: *IoUring) !void
Unregister the registered eventfd file descriptor.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn unregister_files(self: *IoUring) !void
Unregisters all registered file descriptors previously associated with the ring.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn unregister_napi(self: *IoUring, napi: *linux.io_uring_napi) !void
- Kind
- function
- Module
std.os.linux.IoUring
pub fn waitid(self: *IoUring, user_data: u64, id_type: linux.P, id: i32, infop: *linux.siginfo_t, options: u32, flags: u32) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `waitid(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn write(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: []const u8, offset: u64) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `write(2)`.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn write_fixed(self: *IoUring, user_data: u64, fd: linux.fd_t, buffer: *posix.iovec, offset: u64, buffer_index: u16) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a IORING_OP_WRITE_FIXED. The `buffer` provided must be registered with the kernel by calling `register_buffers` first.
- Kind
- function
- Module
std.os.linux.IoUring
pub fn writev(self: *IoUring, user_data: u64, fd: linux.fd_t, iovecs: []const posix.iovec_const, offset: u64) !*linux.io_uring_sqe
Queues (but does not submit) an SQE to perform a `pwritev()`.
- Kind
- function
- Module
std.os.linux.IoUring