Module io_uring
Available on crate feature
dep_rustix
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
Structs§
- AtFlags
AT_*
constants for use withopenat
,statat
, and other*at
functions.- Epoll
Event - A record of an event that occurred.
- Epoll
Event Flags EPOLL*
for use withepoll::add
.- Ioring
Accept Flags - accept flags (
sqe.ioprio
) - Ioring
Async Cancel Flags IORING_ASYNC_CANCEL_*
flags for use withio_uring_sqe
.- Ioring
CqFlags IORING_CQ_*
flags.- Ioring
CqeFlags IORING_CQE_F_*
flags for use withio_uring_cqe
.- Ioring
Enter Flags IORING_ENTER_*
flags for use withio_uring_enter
.- Ioring
Feature Flags IORING_FEAT_*
flags for use withio_uring_params
.- Ioring
Fsync Flags IORING_FSYNC_*
flags for use withio_uring_sqe
.- Ioring
Msgring Flags IORING_MSG_RING_*
flags for use withio_uring_sqe
.- Ioring
OpFlags IO_URING_OP_*
flags for use withio_uring_probe_op
.- Ioring
Poll Flags IORING_POLL_*
flags.- Ioring
Recv Flags - recv/recvmsg flags (
sqe.ioprio
) - Ioring
Register Flags IORING_REGISTER_*
flags for use withio_uring_register_with
.- Ioring
Rsrc Flags IORING_RSRC_*
flags for use withio_uring_rsrc_register
.- Ioring
Send Flags - send/sendmsg flags (
sqe.ioprio
) - Ioring
Setup Flags IORING_SETUP_*
flags for use withio_uring_params
.- Ioring
SqFlags IORING_SQ_*
flags.- Ioring
SqeFlags IOSQE_*
flags for use withio_uring_sqe
.- Ioring
Timeout Flags IORING_TIMEOUT_*
andIORING_LINK_TIMEOUT_UPDATE
flags for use withio_uring_sqe
.- Mode
S_I*
constants for use withopenat
,chmodat
, andfchmod
.- OFlags
O_*
constants for use withopenat
.- Read
Write Flags RWF_*
constants for use withpreadv2
andpwritev2
.- Recv
Flags MSG_*
flags for use withrecv
,recvfrom
, and related functions.- Recvmsg
OutFlags - recvmsg out flags
- Rename
Flags RENAME_*
constants for use withrenameat_with
.- Resolve
Flags RESOLVE_*
constants for use withopenat2
.- Send
Flags MSG_*
flags for use withsend
,sendto
, and related functions.- Socket
Flags SOCK_*
constants for use withsocket_with
,accept_with
andacceptfrom_with
.- Splice
Flags SPLICE_F_*
flags for use withio_uring_sqe
.- Statx
Flags STATX_*
constants for use withstatx
.- Xattr
Flags XATTR_*
constants for use withsetxattr
, and other*setxattr
functions.- 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_ cqe - An io_uring Completion Queue Entry.
- io_
uring_ files_ update - io_
uring_ getevents_ arg - 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_ 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
- msghdr
- open_
how - sockaddr
- sockaddr_
storage - tail_
or_ bufs_ struct
Enums§
- Advice
POSIX_FADV_*
constants for use withfadvise
.- Ioring
Msgring Cmds IORING_MSG_*
constants which represent commands for use withIoringOp::MsgRing
, (seq.addr
)- Ioring
Op IORING_OP_*
constants for use withio_uring_sqe
.- Ioring
Register Op IORING_REGISTER_*
andIORING_UNREGISTER_*
constants for use withio_uring_register
.- Ioring
Restriction Op IORING_RESTRICTION_*
constants for use withio_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
Functions§
- io_
uring_ ⚠enter io_uring_enter(fd, to_submit, min_complete, flags, arg, size)
—Initiate and/or complete asynchronous I/O.- io_
uring_ ⚠register io_uring_register(fd, opcode, arg, nr_args)
—Register files or user buffers for asynchronous I/O.- io_
uring_ register_ files_ skip IORING_REGISTER_FILES_SKIP
- 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_sec
field ofTimespec
. - Secs
- A type for the
tv_sec
field ofTimespec
. - Statx
struct statx
for use withstatx
.- Timespec
struct timespec
- c_char
- The C
char
type. - sigset_
t - socklen_
t
Unions§
- Epoll
Event Data - Data associated with an
epoll::Event
. This can either be a 64-bit integer value or a pointer which preserves pointer provenance. - 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_ union