io_uring_wait_cqe_timeout - Man Page

wait for one io_uring completion event with timeout

Synopsis

#include <liburing.h>

int io_uring_wait_cqe_timeout(struct io_uring *ring,
                              struct io_uring_cqe **cqe_ptr,
                              struct __kernel_timespec *ts);

Description

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.

If ts is NULL , then this behaves like io_uring_wait_cqe(3) in that it will wait forever for an event.

Return Value

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.

See Also

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

Referenced By

io_uring_cq_advance(3), io_uring_cqe_seen(3), io_uring_for_each_cqe(3), io_uring_register_clock(3), io_uring_wait_cqe(3), io_uring_wait_cqes(3), io_uring_wait_cqes_min_timeout(3).

November 15, 2021 liburing-2.1 liburing Manual