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 :-)