ustream: add function ustream_read().
authorYousong Zhou <yszhou4tech@gmail.com>
Wed, 21 Jan 2015 13:21:25 +0000 (21:21 +0800)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 21 Jan 2015 19:00:39 +0000 (20:00 +0100)
It can be used to fill caller-specified buffer with data already in
ustream read buffer.  Useful in the following use pattern.

int available = ustream_pending_data(s, false);
if (available >= sizeof(struct msghdr)) {
struct msghdr h;
ustream_read(s, &h, sizeof(h));
}

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

No differences found