Module io_uring

Source
Available on crate feature io_uring only.
Expand description

Linux io_uring.

This API is very low-level. The main adaptations it makes from the raw Linux io_uring API are the use of appropriately-sized bitflags, enum, Result, OwnedFd, AsFd, RawFd, and *mut c_void in place of plain integers.

For a higher-level API built on top of this, see the rustix-uring crate.

§Safety

io_uring operates on raw pointers and raw file descriptors. Rustix does not attempt to provide a safe API for these, because the abstraction level is too low for this to be practical. Safety should be introduced in higher-level abstraction layers.

§References

Re-exports§

pub use crate::event::epoll::Event as EpollEvent;
pub use crate::event::epoll::EventData as EpollEventData;
pub use crate::event::epoll::EventFlags as EpollEventFlags;
pub use crate::fs::Advice;
pub use crate::fs::AtFlags;
pub use crate::fs::Mode;
pub use crate::fs::OFlags;
pub use crate::fs::RenameFlags;
pub use crate::fs::ResolveFlags;
pub use crate::fs::Statx;
pub use crate::fs::StatxFlags;
pub use crate::fs::XattrFlags;
pub use crate::io::ReadWriteFlags;
pub use crate::net::addr::SocketAddrLen;
pub use crate::net::addr::SocketAddrOpaque;
pub use crate::net::addr::SocketAddrStorage;
pub use crate::net::RecvFlags;
pub use crate::net::SendFlags;
pub use crate::net::SocketFlags;
pub use crate::thread::futex::Wait as FutexWait;
pub use crate::thread::futex::WaitFlags as FutexWaitFlags;
pub use crate::thread::futex::WaitPtr as FutexWaitPtr;
pub use crate::thread::futex::WaitvFlags as FutexWaitvFlags;

Structs§

IoringAcceptFlags
accept flags (sqe.ioprio)
IoringAsyncCancelFlags
IORING_ASYNC_CANCEL_* flags for use with io_uring_sqe.
IoringCqFlags
IORING_CQ_* flags.
IoringCqeFlags
IORING_CQE_F_* flags for use with io_uring_cqe.
IoringEnterFlags
IORING_ENTER_* flags for use with io_uring_enter.
IoringFeatureFlags
IORING_FEAT_* flags for use with io_uring_params.
IoringFixedFdFlags
IORING_FIXED_FD_* flags for use with io_uring_sqe.
IoringFsyncFlags
IORING_FSYNC_* flags for use with io_uring_sqe.
IoringMsgringFlags
IORING_MSG_RING_* flags for use with io_uring_sqe.
IoringOpFlags
IO_URING_OP_* flags for use with io_uring_probe_op.
IoringPollFlags
IORING_POLL_* flags.
IoringRecvFlags
recv/recvmsg flags (sqe.ioprio)
IoringRegisterFlags
IORING_REGISTER_* flags for use with io_uring_register_with.
IoringRsrcFlags
IORING_RSRC_* flags for use with io_uring_rsrc_register.
IoringSendFlags
send/sendmsg flags (sqe.ioprio)
IoringSetupFlags
IORING_SETUP_* flags for use with io_uring_params.
IoringSqFlags
IORING_SQ_* flags.
IoringSqeFlags
IOSQE_* flags for use with io_uring_sqe.
IoringTimeoutFlags
IORING_TIMEOUT_* and IORING_LINK_TIMEOUT_UPDATE flags for use with io_uring_sqe.
IoringUringCmdFlags
IORING_URING_CMD_* flags for use with io_uring_sqe.
KernelSigSet
kernel_sigset_t—A set of signal numbers, as used by some syscalls.
MsgHdr
msghdr
RecvmsgOutFlags
recvmsg out flags
Signal
A signal number for use with kill_process, kill_process_group, and kill_current_process_group.
SpliceFlags
SPLICE_F_* flags for use with io_uring_sqe.
Timespec
struct timespec—A quantity of time in seconds plus nanoseconds.
addr3_struct
addr_len_struct
buf_ring_bufs_struct
buf_ring_tail_struct
cmd_op_struct
io_cqring_offsets
io_sqring_offsets
io_uring_buf
io_uring_buf_reg
io_uring_buf_ring
io_uring_clone_buffers
io_uring_cqe
An io_uring Completion Queue Entry.
io_uring_files_update
io_uring_getevents_arg
io_uring_napi
io_uring_params
io_uring_probe
io_uring_probe_op
io_uring_ptr
A pointer in the io_uring API.
io_uring_recvmsg_out
io_uring_reg_wait
io_uring_restriction
io_uring_rsrc_register
io_uring_rsrc_update
io_uring_rsrc_update2
io_uring_sqe
An io_uring Submission Queue Entry.
io_uring_sync_cancel_reg
iovec
open_how
tail_or_bufs_struct

Enums§

ClockId
CLOCK_* constants for use with clock_gettime.
IoringMsgringCmds
IORING_MSG_* constants which represent commands for use with IoringOp::MsgRing, (seq.addr)
IoringOp
IORING_OP_* constants for use with io_uring_sqe.
IoringRegisterOp
IORING_REGISTER_* and IORING_UNREGISTER_* constants for use with io_uring_register.
IoringRestrictionOp
IORING_RESTRICTION_* constants for use with io_uring_restriction.

Constants§

IORING_CQE_BUFFER_SHIFT
IORING_FILE_INDEX_ALLOC
IORING_NOTIF_USAGE_ZC_COPIED
IORING_NOTIF_USAGE_ZC_COPIED (since Linux 6.2)
IORING_OFF_CQ_RING
IORING_OFF_SQES
IORING_OFF_SQ_RING
IORING_REGISTER_FILES_SKIP
IORING_REGISTER_FILES_SKIP

Functions§

io_uring_enter
io_uring_enter(fd, to_submit, min_complete, flags, 0, 0)—Initiate and/or complete asynchronous I/O.
io_uring_enter_arg
io_uring_enter2(fd, to_submit, min_complete, flags, arg, sizeof(*arg))— Initiate and/or complete asynchronous I/O, with a signal mask and a timeout.
io_uring_enter_sigmask
io_uring_enter(fd, to_submit, min_complete, flags, sigmask, sizeof(*sigmask))— Initiate and/or complete asynchronous I/O, with a signal mask.
io_uring_register
io_uring_register(fd, opcode, arg, nr_args)—Register files or user buffers for asynchronous I/O.
io_uring_register_with
io_uring_register_with(fd, opcode, flags, arg, nr_args)—Register files or user buffers for asynchronous I/O.
io_uring_setup
io_uring_setup(entries, params)—Setup a context for performing asynchronous I/O.

Type Aliases§

Nsecs
A type for the tv_nsec field of Timespec.
Secs
A type for the tv_sec field of Timespec.
c_char
Equivalent to C’s char type.

Unions§

addr3_or_cmd_union
addr_or_splice_off_in_union
buf_union
io_uring_user_data
User data in the io_uring API.
ioprio_union
len_union
off_or_addr2_union
op_flags_union
register_or_sqe_op_or_sqe_flags_union
splice_fd_in_or_file_index_or_addr_len_union