io_uring_wait_cqe_timeout(3) liburing Manual io_uring_wait_cqe_timeout(3)

io_uring_wait_cqe_timeout - wait for one io_uring completion event with timeout

#include <liburing.h>
int io_uring_wait_cqe_timeout(struct io_uring *ring,
                              struct io_uring_cqe **cqe_ptr,
                              struct __kernel_timespec *ts);

The io_uring_wait_cqe_timeout(3) function waits for one IO completion to be available from the queue belonging to the ring param, waiting for it if necessary or until the timeout ts expires. If an event is already available in the ring when invoked, no waiting will occur.

The cqe_ptr param is filled in on success.

If ts is specified and an older kernel without IORING_FEAT_EXT_ARG is used, the application does not need to call io_uring_submit(3) before calling io_uring_wait_cqes(3). For newer kernels with that feature flag set, there is no implied submit when waiting for a request.

On success io_uring_wait_cqe_timeout(3) returns 0 and the cqe_ptr param is filled in. On failure it returns -errno. The return value indicates the result of waiting for a CQE, and it has no relation to the CQE result itself.

io_uring_submit(3), io_uring_wait_cqes(3), io_uring_wait_cqe(3)

November 15, 2021 liburing-2.1