Add io_uring_prep_timeout_update() helper and update io_uring.h. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- src/include/liburing.h | 9 +++++++++ src/include/liburing/io_uring.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/include/liburing.h b/src/include/liburing.h index cc32232..ebfc424 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -326,6 +326,15 @@ static inline void io_uring_prep_timeout_remove(struct io_uring_sqe *sqe, sqe->timeout_flags = flags; } +static inline void io_uring_prep_timeout_update(struct io_uring_sqe *sqe, + struct __kernel_timespec *ts, + __u64 user_data, unsigned flags) +{ + io_uring_prep_rw(IORING_OP_TIMEOUT_REMOVE, sqe, -1, + (void *)(unsigned long)user_data, 0, (__u64)ts); + sqe->timeout_flags = flags | IORING_TIMEOUT_UPDATE; +} + static inline void io_uring_prep_accept(struct io_uring_sqe *sqe, int fd, struct sockaddr *addr, socklen_t *addrlen, int flags) diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h index 8555de9..abdc737 100644 --- a/src/include/liburing/io_uring.h +++ b/src/include/liburing/io_uring.h @@ -155,6 +155,7 @@ enum { * sqe->timeout_flags */ #define IORING_TIMEOUT_ABS (1U << 0) +#define IORING_TIMEOUT_UPDATE (1U << 31) /* * sqe->splice_flags -- 2.24.0