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);
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -717,6 +717,7 @@
|
|||
struct pipe_peek_s
|
||||
{
|
||||
FAR void *buf;
|
||||
size_t offset;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue