Re: Honoring SO_RCVLOWAT in proto_ops.poll methods

From: Alan Cox
Date: Sun Sep 21 2008 - 10:18:27 EST


> > You might also want to look at the socket(7) man page which implies that
> > what Linux currently does is exceptional & incorrect:

Actually we follow 1003.1g draft 6.4 which is about as close as there
ever was a spec for BSD sockets. We go beyond it actually -
SO_RCVLOWAT/SO_SNDLOWAT are in fact optional.

> SO_RCVLOWAT, and to my surprise even my recv() calls with MSG_PEEK flags
> set are not blocking. They block without MSG_PEEK, but not with.

Correct and we've always done that intentionally.

> At this point, for my application to work on Linux without burning CPU like
> mad... I basically have to sleep and poll the socket regularly to see if
> more data has arrived with the tcp socket ioctl SIOCINQ. :(

What are you actually trying to do ? The usual way to handle urgent data
in those odd cases that use it is to select for an exception event.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/