[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101209161734.GA16822@dezo.moloch.sk>
Date: Thu, 9 Dec 2010 17:17:34 +0100
From: Martin Lucina <mato@...elna.sk>
To: linux-kernel@...r.kernel.org
Cc: Martin Sustrik <sustrik@...bpm.com>
Subject: [PATCH] Document the kernel_recvmsg() function
Hi,
so, today we spent all day figuring out how the kernel_sendmsg() function
*actually* works. This patch adds some documentation to help the next poor
sod.
-mato
>From b29ccddeec4b782d710ffe34e0e5e4a0f5e9c24b Mon Sep 17 00:00:00 2001
From: Martin Lucina <mato@...elna.sk>
Date: Thu, 9 Dec 2010 17:11:18 +0100
Subject: [PATCH] Document the kernel_recvmsg() function
Signed-off-by: Martin Lucina <mato@...elna.sk>
---
net/socket.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 3ca2fd9..b17333d 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -732,6 +732,21 @@ static int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg,
return ret;
}
+/**
+ * kernel_recvmsg() - Receive a message from a socket (kernel space)
+ * @sock: The socket to receive the message from
+ * @msg: Received message
+ * @vec: Input s/g array for message data
+ * @num: Size of input s/g array
+ * @size: Number of bytes to read
+ * @flags: Message flags (MSG_DONTWAIT, etc...)
+ *
+ * On return the msg structure contains the scatter/gather array passed in the
+ * vec argument. The array is modified so that it consists of the unfilled
+ * portion of the original array.
+ *
+ * The returned value is the total number of bytes received, or an error.
+ */
int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
struct kvec *vec, size_t num, size_t size, int flags)
{
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists