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)
commit60236c485387d33e1d02398a953a0834ad125161
treeca3c355aad62de5fc0041dcb4a003924adf829cc
parentf1c794b29e2dac52ec25869bf8c37b3e230fb2a2
ustream: add function ustream_read().

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>
ustream.c
ustream.h