MCPcopy Create free account
hub / github.com/axboe/liburing / __io_uring_submit_timeout

Function __io_uring_submit_timeout

src/queue.c:331–352  ·  view source on GitHub ↗

* Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note * that an sqe is used internally to handle the timeout. For kernel doesn't * support IORING_FEAT_EXT_ARG, applications using this function must never * set sqe->user_data to LIBURING_UDATA_TIMEOUT! * * For kernels without IORING_FEAT_EXT_ARG (5.10 and older), if 'ts' is * specified, the application need not call io_u

Source from the content-addressed store, hash-verified

329 * handling between two threads.
330 */
331static int __io_uring_submit_timeout(struct io_uring *ring, unsigned wait_nr,
332 struct __kernel_timespec *ts)
333{
334 struct io_uring_sqe *sqe;
335 int ret;
336
337 /*
338 * If the SQ ring is full, we may need to submit IO first
339 */
340 sqe = io_uring_get_sqe(ring);
341 if (!sqe) {
342 ret = io_uring_submit(ring);
343 if (ret < 0)
344 return ret;
345 sqe = io_uring_get_sqe(ring);
346 if (!sqe)
347 return -EAGAIN;
348 }
349 io_uring_prep_timeout(sqe, ts, wait_nr, 0);
350 sqe->user_data = LIBURING_UDATA_TIMEOUT;
351 return __io_uring_flush_sq(ring);
352}
353
354int io_uring_wait_cqes(struct io_uring *ring, struct io_uring_cqe **cqe_ptr,
355 unsigned wait_nr, struct __kernel_timespec *ts,

Callers 2

io_uring_wait_cqesFunction · 0.85

Calls 3

io_uring_submitFunction · 0.85
io_uring_get_sqeFunction · 0.70
__io_uring_flush_sqFunction · 0.70

Tested by

no test coverage detected