On Fri, 2015-10-23 at 17:40 +0100, Alan Burlison wrote: > On 23/10/2015 17:19, Eric Dumazet wrote: > > >>> The AF_UNIX poll one? No, I don't have the means to do so, and in any > >>> case that's not a POSIX issue, just a plain bug. I'm happy to log a bug > >>> if that helps. > > > > BTW, there is no kernel bug here. POSIX poll() man page says : > > > > POLLOUT > > Normal data may be written without blocking. > > > > If you attempt to write on a listener, write() does _not_ block and > > returns -1, which seems correct behavior to me, in accordance with man > > page. > > Except of course data may not be written, because an attempt to actually > do so fails, because the socket is in the listen state, is not connected > and therefore no attempt to write to it could ever succeed. The only bit > of the required behaviour that the current AF_UNIX poll implementation > actually gets right is the "without blocking" bit, and that's only the > case because the failure is detected immediately and the write call > returns immediately with an error.
Yeah, I know some people use poll(NULL, 0, timeout) to implement msleep(). Because it definitely impresses friends. So why not poll(&pfd, 1, timeout) to do the same, with a socket listener and POLLOUT in pfd.events Go figure. I'll send the fine patch. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html