Re: O_NONBLOCK is broken

2007-08-19 Thread Denys Vlasenko
On Tuesday 14 August 2007 22:59, David Schwartz wrote: > > The problem is, O_NONBLOCK flag is not attached to file *descriptor*, > > but to a "file description" mentioned in fcntl manpage: > > [snip] > > > We don't know whether our stdout descriptor #1 is shared with > > anyone or not, > > and if w

[PATCH] allow send/recv(MSG_DONTWAIT) on non-sockets (was Re: O_NONBLOCK is broken)

2007-08-19 Thread Denys Vlasenko
On Tuesday 14 August 2007 13:33, Alan Cox wrote: > > b) Make recv(fd, buf, size, flags) and send(fd, buf, size, flags); > >work with non-socket fds too, for flags==0 or flags==MSG_DONTWAIT. > >(it's ok to fail with "socket op on non-socket fd" for other values > >of flags) > > I think t

RE: O_NONBLOCK is broken

2007-08-14 Thread David Schwartz
> The problem is, O_NONBLOCK flag is not attached to file *descriptor*, > but to a "file description" mentioned in fcntl manpage: [snip] > We don't know whether our stdout descriptor #1 is shared with > anyone or not, > and if we were started from shell, it typically is. That's why we try to > res

Re: O_NONBLOCK is broken

2007-08-14 Thread Jan Engelhardt
On Aug 14 2007 13:33, Alan Cox wrote: > >> b) Make recv(fd, buf, size, flags) and send(fd, buf, size, flags); >>work with non-socket fds too, for flags==0 or flags==MSG_DONTWAIT. >>(it's ok to fail with "socket op on non-socket fd" for other values >>of flags) > >I think that makes a l

Re: O_NONBLOCK is broken

2007-08-14 Thread Alan Cox
> b) Make recv(fd, buf, size, flags) and send(fd, buf, size, flags); >work with non-socket fds too, for flags==0 or flags==MSG_DONTWAIT. >(it's ok to fail with "socket op on non-socket fd" for other values >of flags) I think that makes a lot of sense, and to be honest other MSG_ flags