io_uring_setup

fnint io_uring_setup(uint entries, io_uring_params * params) @system

Set up an io_uring instance.

Creates a new io_uring instance with the specified number of submission queue entries. The params structure is filled by the kernel with ring configuration details needed for subsequent mmap() calls.

Parameters

entriesRequested number of submission queue entries (will be rounded up to power of 2).
paramsParameters struct; flags may be set by caller, rest filled by kernel on success.

Returns

File descriptor for the io_uring instance on success, or -1 on error (check errno).

Throws

Does not throw. Returns -1 on error and sets errno.

Returns ENOSYS if the kernel does not support io_uring (Linux < 5.1).