Re: Fw: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-23 Thread David Holland
On Wed, Oct 21, 2015 at 03:38:51PM +0100, Alan Burlison wrote: > On 21/10/2015 04:49, Al Viro wrote: > >BTW, for real fun, consider this: > >7) > >// fd is a socket > >fd2 = dup(fd); > >in thread A: accept(fd); > >in thread B: accept(fd); > >in thread C: accept(fd2); > >in thread D:

Re: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-29 Thread David Holland
On Thu, Oct 29, 2015 at 03:18:40PM +, Alan Burlison wrote: > On 29/10/2015 14:58, David Holland wrote: > >ISTM that the best way to do this is to post a signal to the thread so > >accept bails with EINTR, at which point it can check to see if it's > >supposed to be exi

Re: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-29 Thread David Holland
On Tue, Oct 27, 2015 at 10:52:46AM +, Alan Burlison wrote: > >But in general, this is basically a problem with the application: the file > >descriptor space is shared between threads and having one thread sniping > >at open files, you do have a problem and whatever the kernel does in that

Re: [Bug 106241] New: shutdown(3)/close(3) behaviour is incorrect for sockets in accept(3)

2015-10-29 Thread David Holland
On Thu, Oct 29, 2015 at 04:15:33PM +, Alan Burlison wrote: > >close(2) as specified by POSIX doesn't prohibit this weird revoke-like > >behavior, but there's nothing in there that mandates it either. (I > >thought this discussion had already clarified that.) > > There was an attempt to