[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140526211706.GA25474@kernel.org>
Date: Mon, 26 May 2014 18:17:06 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
"linux-man@...r.kernel.org" <linux-man@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
Ondřej Bílka <neleai@...nam.cz>,
Caitlin Bestler <caitlin.bestler@...il.com>,
Neil Horman <nhorman@...driver.com>,
Elie De Brauwer <eliedebrauwer@...il.com>,
David Miller <davem@...emloft.net>,
Steven Whitehouse <steve@...gwyn.com>,
Rémi Denis-Courmont
<remi.denis-courmont@...ia.com>, Paul Moore <paul@...l-moore.com>,
Chris Friesen <chris.friesen@...driver.com>
Subject: Re: [PATCH/RFC] Re: recvmmsg() timeout behavior strangeness [RESEND]
Em Mon, May 26, 2014 at 10:46:47AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, May 22, 2014 at 04:27:45PM +0200, Michael Kerrisk (man-pages) escreveu:
> > Thanks! I applied this patch against 3.15-rc6.
> > recvmmsg() now (mostly) does what I expect:
> > * it waits until either the timeout expires or vlen messages
> > have been received
> > * If no message is received before timeout, it returns -1/EAGAIN.
> > * If vlen messages are received before the timeout expires, then
> > the remaining time is returned in timeout.
> > One question: in the event that the call is interrupted by a signal
> > handler, it fails (as expected) with EINTR, but the 'timeout' value is
> > not updated with the remaining time on the timer. Would it be desirable
> > to emulate the behavior of select() (and other syscalls) in this
> > respect, and instead return the remaining time if interrupted by
> > a signal?
> I think so, will check how to achieve that!
Can you try the attached patch on top of the first one?
It starts adding explicit parentheses on a ternary, as David requested,
and then should return the remaining timeouts in cases like signals,
etc.
Please let me know if this is enough.
- Arnaldo
P.S. compile testing while sending this message :-)
View attachment "recvmsg-return-timeout-harder.patch" of type "text/plain" (5544 bytes)
Powered by blists - more mailing lists