On Tue, 2015-10-20 at 14:45 +0100, Alan Burlison wrote: > And I still haven't seen any reasoning behind the Linux close() and > poll() behaviour on sockets that are in the listen state.
Same answer. A close() does _not_ wakeup an accept() or a poll() (this is exactly the same problem), or any blocking system call using the same 'file' This is the choice Linus Torvalds and Al Viro did years ago. It is set in stone, unless someone comes up with a very nice patch set, that does not break existing applications. close() man page states : NOTES It is probably unwise to close file descriptors while they may be in use by system calls in other threads in the same process. Since a file descriptor may be reused, there are some obscure race conditions that may cause unintended side effects. You are in this grey zone. -- 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