Thread (37 messages) 37 messages, 7 authors, 2014-06-27

Re: [PATCH/RFC] Re: recvmmsg() timeout behavior strangeness [RESEND]

From: Michael Kerrisk (man-pages) <hidden>
Date: 2014-05-24 12:24:46
Also in: linux-man, lkml

On 05/23/2014 09:55 PM, Arnaldo Carvalho de Melo wrote:
Em Fri, May 23, 2014 at 03:00:55PM -0400, David Miller escreveu:
quoted
From: Arnaldo Carvalho de Melo <redacted>
Date: Wed, 21 May 2014 18:05:35 -0300
quoted
quoted
But after thinking a bit more, looks like we need to do that, please
take a look at the attached patch to see if it addresses the problem.
quoted
quoted
Mostly it adds a new timeop to the per protocol recvmsg()
implementations, that, if not NULL, should be used instead of
SO_RCVTIMEO.
quoted
quoted
since the underlying recvmsg implementations already check that timeout,
return what is remaining, that will then be used in subsequent recvmsg
calls, at the end we just convert it back to timespec format.
quoted
quoted
In most cases it is just passed to skb_recv_datagram, that will check
the pointer, use it and update if not NULL.
quoted
quoted
Should have no problems, but I only did a boot with a system with this
patch applied, no problems noticed on a normal desktop session, ssh,
etc.
 
quoted
This looks fine to me, but I have a small request:
 
quoted
+	return noblock ? 0 : timeop ? *timeop : sk->sk_rcvtimeo;
 
quoted
I keep forgetting which way these expressions associate, so if you could
parenthesize the innermost ?: I'd appreciate it. :)
Ok, I actually wrote a sample program to verify that these ternaries did
what I meant 8)

I'll finish the cset log and do this clarification change.

Would be great to get Acked-by tags from the original reporter, Michael
and whoever had a look at this change, if possible. Michael, Elie?
Arnaldo, I already sent you a reply (will reping on that one),
but got no response. My light testing got the expected results,
but I still had one question about the semantics.

Cheers,

Michael



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help