aboutsummaryrefslogtreecommitdiff
path: root/chardev
diff options
context:
space:
mode:
authormanish.mishra <manish.mishra@nutanix.com>2022-12-20 18:44:17 +0000
committerJuan Quintela <quintela@redhat.com>2023-02-06 19:22:56 +0100
commit84615a19ddf2bfb38d7b3a0d487d2397ee55e4f3 (patch)
tree80eff6fda458ab19eb99ba928aac2da4f5e66b17 /chardev
parentbd9510d38546a19aa2e58e1a94597acfb0fd82d4 (diff)
io: Add support for MSG_PEEK for socket channel
MSG_PEEK peeks at the channel, The data is treated as unread and the next read shall still return this data. This support is currently added only for socket class. Extra parameter 'flags' is added to io_readv calls to pass extra read flags like MSG_PEEK. Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: manish.mishra <manish.mishra@nutanix.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/char-socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 29ffe5075e..c2265436ac 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -283,11 +283,11 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
if (qio_channel_has_feature(s->ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
ret = qio_channel_readv_full(s->ioc, &iov, 1,
&msgfds, &msgfds_num,
- NULL);
+ 0, NULL);
} else {
ret = qio_channel_readv_full(s->ioc, &iov, 1,
NULL, NULL,
- NULL);
+ 0, NULL);
}
if (msgfds_num) {