Re: Kill SS_NBIO

2018-07-20 Thread Alexander Bluhm
On Thu, Jul 12, 2018 at 06:18:06PM +0200, Martin Pieuchot wrote: > > > @@ -1157,8 +1154,7 @@ sosplice(struct socket *so, int fd, off_ > > > } > > > > > > /* Lock both receive and send buffer. */ > > > - if ((error = sblock(so, &so->so_rcv, > > > - (so->so_state & SS_NBIO) ? M_NOWAIT : M_W

Re: Kill SS_NBIO

2018-07-12 Thread Martin Pieuchot
On 12/07/18(Thu) 17:53, Alexander Bluhm wrote: > On Thu, Jul 12, 2018 at 02:38:48PM +0200, Martin Pieuchot wrote: > > @@ -83,12 +91,6 @@ soo_ioctl(struct file *fp, u_long cmd, c > > switch (cmd) { > > > > case FIONBIO: > > - s = solock(so); > > - if (*(int *)data) > >

Re: Kill SS_NBIO

2018-07-12 Thread Alexander Bluhm
On Thu, Jul 12, 2018 at 02:38:48PM +0200, Martin Pieuchot wrote: > @@ -83,12 +91,6 @@ soo_ioctl(struct file *fp, u_long cmd, c > switch (cmd) { > > case FIONBIO: > - s = solock(so); > - if (*(int *)data) > - so->so_state |= SS_NBIO; > -

Kill SS_NBIO

2018-07-12 Thread Martin Pieuchot
Sockets and files have one flag each to indicate the I/O mode is non-blocking. This is redundant. Keeping both flags in sync is hard since races can happen between the two different layers. So the diff below gets rid of SS_NBIO. It is fairly simple since sosend(9) and soreceive(9) already take