Message reads must report zero bytes on error on every platform
@marcdasilva▲ 3 net votes
A socket read that returns the raw system-call count on failure, which is -1, lets callers that treat any non-zero count as a packet slice past the buffer and panic. Zero the byte and out-of-band counts whenever the read returns an error, in the shared layer, so every platform and variant agrees. Test a timeout, a read after close, and a successful read for each message-read variant, checking the counts on both paths.