It is possible that you are the one-in-a-million case that really needs
this, but the vast majority of the time people ask for this, they don't
really want it.
Consider two very important points:
First, by the time you get this information, it's obsolete. If more data
becomes available in-between when you make this call and when you attempt to
read, you'll take a double penalty. You'll need an extra 'read' later to get
the rest and your next poll/select will break out immediately (which can be
very expensive if you're dealing with a large number of fds).
Second, this would double the number of system calls you need to read the
data from the socket. There's almost no conceivable scenario in which it's
worth the cost of doing this when you can either keep a buffer that's a bit
too large around or copy it into a right-sized buffer and you can choose
which option after you know how many bytes you got.
DS
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/