From f601a80bb95954f13028aa44554da53d94fc5ff1 Mon Sep 17 00:00:00 2001 From: Brandon L Black Date: Fri, 26 Mar 2010 16:18:03 +0000 Subject: [PATCH] --- yaml --- r: 189171 b: refs/heads/master c: 71c5c1595c04852d6fbf3c4882b47b30b61a4d32 h: refs/heads/master i: 189169: 12001f30f2e8b86e4160d1174fcd34ecc1756ebb 189167: 0b53e6f651a74fb56cda5a105fabb5704f0c04d1 v: v3 --- [refs] | 2 +- trunk/include/linux/socket.h | 1 + trunk/net/socket.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c4ad08e00a06..cd1226efb5de 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f49c57e141c7f53353e4265a31dc2324e6215037 +refs/heads/master: 71c5c1595c04852d6fbf3c4882b47b30b61a4d32 diff --git a/trunk/include/linux/socket.h b/trunk/include/linux/socket.h index 7b3aae2052a6..354cc5617f8b 100644 --- a/trunk/include/linux/socket.h +++ b/trunk/include/linux/socket.h @@ -255,6 +255,7 @@ struct ucred { #define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */ #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */ #define MSG_MORE 0x8000 /* Sender will send more */ +#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */ #define MSG_EOF MSG_FIN diff --git a/trunk/net/socket.c b/trunk/net/socket.c index 769c386bd428..f55ffe9f8c87 100644 --- a/trunk/net/socket.c +++ b/trunk/net/socket.c @@ -2135,6 +2135,10 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, break; ++datagrams; + /* MSG_WAITFORONE turns on MSG_DONTWAIT after one packet */ + if (flags & MSG_WAITFORONE) + flags |= MSG_DONTWAIT; + if (timeout) { ktime_get_ts(timeout); *timeout = timespec_sub(end_time, *timeout);