liburing
liburing copied to clipboard
recvmsg returns EINVAL when trying to retrieve control message
I am trying to use io_uring_prep_recvmsg. I set up the struct msghdr correctly but always get an EINVAL return code.
Excerpt from my setup:
ctx->iov.iov_base = reinterpret_cast<char*>(buf.data()),
ctx->iov.iov_len = buf.size();
memset(ctx->cmsg, 0, sizeof(ctx->cmsg));
ctx->msg.msg_control = ctx->cmsg;
ctx->msg.msg_controllen = sizeof(ctx->cmsg);
ctx->msg.msg_iov = &ctx->iov;
ctx->msg.msg_iovlen = 1;
io_uring_prep_recvmsg(sqe, fd, &ctx->msg, 0);
If I replace the last line with a plain recvmsg call it works as expected.
If I leave msg_control and msg_controllen unset, it also works with io_uring_prep_recvmsg.
My kernel version is 5.4. Are there any known limitations around this?
cmsg is not supported in older kernels, it'll work in newer ones.
Slightly related, is the support in 5.4 missing sockets completely? readv/writev return EINVAL with 5.4 too.
Slightly related, is the support in 5.4 missing sockets completely?
readv/writevreturnEINVALwith 5.4 too.
No, it should work, I think, at least I don't remember any restriction like that
Slightly related, is the support in 5.4 missing sockets completely?
readv/writevreturnEINVALwith 5.4 too.No, it should work, I think, at least I don't remember any restriction like that
Verified that it does work.