diff options
Diffstat (limited to 'uring.c')
-rw-r--r-- | uring.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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; |