summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-04-15 19:43:47 -0600
committerJens Axboe <axboe@kernel.dk>2022-04-15 19:43:47 -0600
commitaa801a8541154ae38559b14bc24cd4a3f5939e80 (patch)
treefcef957147d5907fd8a3cca1c5324284b2de1d58
parentcdc632f1145f4862bbfe443b4329cc82bd847469 (diff)
downloadliburing-aa801a8541154ae38559b14bc24cd4a3f5939e80.tar.gz
liburing-aa801a8541154ae38559b14bc24cd4a3f5939e80.tar.bz2
liburing.h: add io_uring_prep_cancel_fd()
This sets up the cancelation request to be fd based. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 5c03061..798dc1c 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -510,6 +510,13 @@ static inline void io_uring_prep_cancel(struct io_uring_sqe *sqe,
sqe->cancel_flags = (__u32) flags;
}
+static inline void io_uring_prep_cancel_fd(struct io_uring_sqe *sqe, int fd,
+ unsigned int flags)
+{
+ io_uring_prep_rw(IORING_OP_ASYNC_CANCEL, sqe, fd, NULL, 0, 0);
+ sqe->cancel_flags = (__u32) flags | IORING_ASYNC_CANCEL_FD;
+}
+
static inline void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
struct __kernel_timespec *ts,
unsigned flags)