diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-09-17 10:02:37 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-17 10:02:37 -0600 |
commit | f102231b0fdbfe8587efda0b24c79a69ee4d8ba7 (patch) | |
tree | a3bc8bc44af0068a233d6aa63ee41162ad20e287 | |
parent | e4d4843db77ab74822f151e214783ba0045515f1 (diff) | |
download | liburing-f102231b0fdbfe8587efda0b24c79a69ee4d8ba7.tar.gz liburing-f102231b0fdbfe8587efda0b24c79a69ee4d8ba7.tar.bz2 |
Add IORING_OP_TIMEOUT opcode
And associated command prep helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | src/include/liburing.h | 7 | ||||
-rw-r--r-- | src/include/liburing/io_uring.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h index c4189b1..5448771 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -10,6 +10,7 @@ extern "C" { #include <signal.h> #include <string.h> #include <inttypes.h> +#include <time.h> #include "liburing/compat.h" #include "liburing/io_uring.h" #include "liburing/barrier.h" @@ -234,6 +235,12 @@ static inline void io_uring_prep_nop(struct io_uring_sqe *sqe) sqe->opcode = IORING_OP_NOP; } +static inline void io_uring_prep_timeout(struct io_uring_sqe *sqe, + struct timespec *ts) +{ + io_uring_prep_rw(IORING_OP_TIMEOUT, sqe, 0, ts, 1, 0); +} + #ifdef __cplusplus } #endif diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h index 96ee9d9..cf3101d 100644 --- a/src/include/liburing/io_uring.h +++ b/src/include/liburing/io_uring.h @@ -61,6 +61,7 @@ struct io_uring_sqe { #define IORING_OP_SYNC_FILE_RANGE 8 #define IORING_OP_SENDMSG 9 #define IORING_OP_RECVMSG 10 +#define IORING_OP_TIMEOUT 11 /* * sqe->fsync_flags |