summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHrvoje Zeba <zeba.hrvoje@gmail.com>2019-11-25 15:22:54 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-25 15:22:54 -0700
commit5065e66a269410b438243a4d1069a972464ee2e0 (patch)
tree5706e1b358f86bccd675122f4b97ad6de956faad
parentba8881038d5eb0709cb4bf0d9c5f036f0d4eaaa5 (diff)
downloadliburing-5065e66a269410b438243a4d1069a972464ee2e0.tar.gz
liburing-5065e66a269410b438243a4d1069a972464ee2e0.tar.bz2
Add io_uring_prep_connect() helper
Signed-off-by: Hrvoje Zeba <zeba.hrvoje@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h7
-rw-r--r--src/include/liburing/io_uring.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 70bb007..7ee7b28 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -295,6 +295,13 @@ static inline void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
sqe->timeout_flags = flags;
}
+static inline void io_uring_prep_connect(struct io_uring_sqe *sqe, int fd,
+ struct sockaddr *addr,
+ socklen_t addrlen)
+{
+ io_uring_prep_rw(IORING_OP_CONNECT, sqe, fd, addr, 0, addrlen);
+}
+
static inline unsigned io_uring_sq_ready(struct io_uring *ring)
{
return ring->sq.sqe_tail - ring->sq.sqe_head;
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 2a15692..4637ed1 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -73,6 +73,7 @@ struct io_uring_sqe {
#define IORING_OP_ACCEPT 13
#define IORING_OP_ASYNC_CANCEL 14
#define IORING_OP_LINK_TIMEOUT 15
+#define IORING_OP_CONNECT 16
/*
* sqe->fsync_flags