summaryrefslogtreecommitdiff
path: root/uring.c
diff options
context:
space:
mode:
Diffstat (limited to 'uring.c')
-rw-r--r--uring.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/uring.c b/uring.c
index 6c16849..188b101 100644
--- a/uring.c
+++ b/uring.c
@@ -429,6 +429,26 @@ uring_openat(struct cfg *cfg, struct uring_task *task, const char *path, callbac
}
void
+uring_tbuf_recvmsg(struct cfg *cfg, struct uring_task *task, callback_t callback)
+{
+ struct io_uring_sqe *sqe;
+
+ if (!task->tbuf) {
+ error("%s: called with no tbuf set\n", __func__);
+ return;
+ }
+
+ sqe = get_sqe(cfg, task);
+ task->tbuf->done = 0;
+ task->tbuf->len = 0;
+ task->tbuf->iov.iov_len = sizeof(task->tbuf->buf);
+ task->tbuf->msg.msg_namelen = task->addr.addrlen;
+ task->callback = callback;
+ io_uring_prep_recvmsg(sqe, task->fd, &task->tbuf->msg, 0);
+ io_uring_sqe_set_data(sqe, task);
+}
+
+void
uring_tbuf_sendmsg(struct cfg *cfg, struct uring_task *task, callback_t callback)
{
struct io_uring_sqe *sqe;