drivers/pipes: Add offset support for PIPEIOC_PEEK
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
6a267fe019
commit
a591adc6d5
@ -846,7 +846,9 @@ int pipecommon_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
DEBUGASSERT(peek && peek->buf);
|
DEBUGASSERT(peek && peek->buf);
|
||||||
|
|
||||||
ret = circbuf_peek(&dev->d_buffer, peek->buf, peek->size);
|
ret = circbuf_peekat(&dev->d_buffer,
|
||||||
|
dev->d_buffer.tail + peek->offset,
|
||||||
|
peek->buf, peek->size);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -717,6 +717,7 @@
|
|||||||
struct pipe_peek_s
|
struct pipe_peek_s
|
||||||
{
|
{
|
||||||
FAR void *buf;
|
FAR void *buf;
|
||||||
|
size_t offset;
|
||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user