aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-04-19 13:38:09 -0600
committerJens Axboe <axboe@kernel.dk>2019-07-09 14:32:14 -0600
commitaa1fa28fc73ea6b740ee7b62bf3b07141883dbb8 (patch)
tree85963ae2cf72deda9bea41efd9492c94e9344b8b /net/socket.c
parentio_uring: add support for sendmsg() (diff)
downloadlinux-dev-aa1fa28fc73ea6b740ee7b62bf3b07141883dbb8.tar.xz
linux-dev-aa1fa28fc73ea6b740ee7b62bf3b07141883dbb8.zip
io_uring: add support for recvmsg()
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. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c
index b9536940255e..98354cc18840 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2494,6 +2494,14 @@ out_freeiov:
* BSD recvmsg interface
*/
+long __sys_recvmsg_sock(struct socket *sock, struct user_msghdr __user *msg,
+ unsigned int flags)
+{
+ struct msghdr msg_sys;
+
+ return ___sys_recvmsg(sock, msg, &msg_sys, flags, 0);
+}
+
long __sys_recvmsg(int fd, struct user_msghdr __user *msg, unsigned int flags,
bool forbid_cmsg_compat)
{