recv() with MSG_PEEK only returns the number of bytes in the first message chain (
aggregated on b_cont) on a stream. Messages accumulated via b_next are not counted.
Work Around
It should be possible to use ioctl(2) with a FIONREAD request which returns
the total number of bytes at the stream head (and also includes what is on
the synchronous barrier).