This is done through IORING_OP_RECVMSG. This opcode uses the same sqe->msg_flags that IORING_OP_SENDMSG added, and we pass in the msghdr struct in the sqe->addr field as well. We use MSG_DONTWAIT to force an inline fast path if recvmsg() doesn't block, and punt to async execution if it would have.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -60,6 +60,7 @@ struct io_uring_sqe { · 59 unmodified lines | ||
| 60 | 60 | #define IORING_OP_POLL_REMOVE 7 |
| 61 | 61 | #define IORING_OP_SYNC_FILE_RANGE 8 |
| 62 | 62 | #define IORING_OP_SENDMSG 9 |
| 63 | +#define IORING_OP_RECVMSG 10 | |
| 63 | 64 | |
| 64 | 65 | /* |
| 65 | 66 | * sqe->fsync_flags |