1io_uring_prep_poll_timeout(3) liburing Manual io_uring_prep_poll_timeout(3)
2
3
4
6 io_uring_prep_timeoute - prepare a timeout request
7
9 #include <liburing.h>
10
11 void io_uring_prep_timeout(struct io_uring_sqe *sqe,
12 struct __kernel_timespec *ts,
13 unsigned count,
14 unsigned flags);
15
17 The io_uring_prep_timeout(3) function prepares a timeout request. The
18 submission queue entry sqe is setup to arm a timeout specified by ts
19 and with a timeout count of count completion entries. The flags argu‐
20 ment holds modifier flags for the request.
21
22 This request type can be used as a timeout waking anyone sleeping for
23 events on the CQ ring. The flags argument may contain:
24
25 IORING_TIMEOUT_ABS
26 The value specified in ts is an absolute value rather than a
27 relative one.
28
29 IORING_TIMEOUT_BOOTTIME
30 The boottime clock source should be used.
31
32 IORING_TIMEOUT_REALTIME
33 The realtime clock source should be used.
34
35 IORING_TIMEOUT_ETIME_SUCCESS
36 Consider an expired timeout a success in terms of the posted
37 completion. Normally a timeout that triggers would return in a
38 -ETIME CQE res value.
39
40 The timeout completion event will trigger if either the specified time‐
41 out has occurred, or the specified number of events to wait for have
42 been posted to the CQ ring.
43
44
46 None
47
49 These are the errors that are reported in the CQE res field. On suc‐
50 cess, 0 is returned.
51
52 -ETIME The specified timeout occurred and triggered the completion
53 event.
54
55 -EINVAL
56 One of the fields set in the SQE was invalid. For example, two
57 clocksources where given, or the specified timeout seconds or
58 nanoseconds where < 0.
59
60 -EFAULT
61 io_uring was unable to access the data specified by ts.
62
63 -ECANCELED
64 The timeout was canceled by a removal request.
65
67 As with any request that passes in data in a struct, that data must re‐
68 main valid until the request has been successfully submitted. It need
69 not remain valid until completion. Once a request has been submitted,
70 the in-kernel state is stable. Very early kernels (5.4 and earlier) re‐
71 quired state to be stable until the completion occurred. Applications
72 can test for this behavior by inspecting the IORING_FEAT_SUBMIT_STABLE
73 flag passed back from io_uring_queue_init_params(3).
74
76 io_uring_get_sqe(3), io_uring_submit(3), io_uring_prep_timeout_re‐
77 move(3), io_uring_prep_timeout_update(3)
78
79
80
81liburing-2.2 March 12, 2022 io_uring_prep_poll_timeout(3)