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§
- A record of an event that occurred.
EPOLL*
for use withepoll::add
.- accept flags (
sqe.ioprio
) IORING_ASYNC_CANCEL_*
flags for use withio_uring_sqe
.IORING_CQ_*
flags.IORING_CQE_F_*
flags for use withio_uring_cqe
.IORING_ENTER_*
flags for use withio_uring_enter
.IORING_FEAT_*
flags for use withio_uring_params
.IORING_FSYNC_*
flags for use withio_uring_sqe
.IORING_MSG_RING_*
flags for use withio_uring_sqe
.IO_URING_OP_*
flags for use withio_uring_probe_op
.IORING_POLL_*
flags.- recv/recvmsg flags (
sqe.ioprio
) IORING_REGISTER_*
flags for use withio_uring_register_with
.IORING_RSRC_*
flags for use withio_uring_rsrc_register
.- send/sendmsg flags (
sqe.ioprio
) IORING_SETUP_*
flags for use withio_uring_params
.IORING_SQ_*
flags.IOSQE_*
flags for use withio_uring_sqe
.O_*
constants for use withopenat
.- recvmsg out flags
RENAME_*
constants for use withrenameat_with
.RESOLVE_*
constants for use withopenat2
.SPLICE_F_*
flags for use withio_uring_sqe
.STATX_*
constants for use withstatx
.- An io_uring Completion Queue Entry.
- A pointer in the io_uring API.
- An io_uring Submission Queue Entry.
Enums§
POSIX_FADV_*
constants for use withfadvise
.IORING_OP_*
constants for use withio_uring_sqe
.IORING_RESTRICTION_*
constants for use withio_uring_restriction
.
Constants§
IORING_NOTIF_USAGE_ZC_COPIED
(since Linux 6.2)
Functions§
io_uring_enter(fd, to_submit, min_complete, flags, arg, size)
—Initiate and/or complete asynchronous I/O.io_uring_register(fd, opcode, arg, nr_args)
—Register files or user buffers for asynchronous I/O.IORING_REGISTER_FILES_SKIP
io_uring_register_with(fd, opcode, flags, arg, nr_args)
—Register files or user buffers for asynchronous I/O.io_uring_setup(entries, params)
—Setup a context for performing asynchronous I/O.
Type Aliases§
- A type for the
tv_sec
field ofTimespec
. - A type for the
tv_sec
field ofTimespec
. struct statx
for use withstatx
.struct timespec
- The C
char
type.
Unions§
- Data associated with an
epoll::Event
. This can either be a 64-bit integer value or a pointer which preserves pointer provenance. - User data in the io_uring API.