io_uring_setup

Setup a context for performing asynchronous I/O.

The io_uring_setup() system call sets up a submission queue (SQ) and completion queue (CQ) with at least entries entries, and returns a file descriptor which can be used to perform subsequent operations on the io_uring instance. The submission and completion queues are shared between userspace and the kernel, which eliminates the need to copy data when initiating and completing I/O.

version(linux)
@nogc @trusted
int
io_uring_setup
(
uint entries
,
scope ref SetupParameters p
)

Parameters

entries uint

Defines how many entries can submission queue hold.

p SetupParameters

SetupParameters

Return Value

Type: int

io_uring_setup(2) returns a new file descriptor on success. The application may then provide the file descriptor in a subsequent mmap(2) call to map the submission and completion queues, or to the io_uring_register(2) or io_uring_enter(2) system calls.

On error, -1 is returned and errno is set appropriately.

See Also

io_uring_setup(2)

Meta