diff options
author | 2023-09-15 14:14:48 +0200 | |
---|---|---|
committer | 2023-09-17 17:42:37 +0100 | |
commit | a8ed71a27ef524c808b518031feac811ed3e741c (patch) | |
tree | 9ffcfb9ba8f645dc027c4ae9123daf1fd3bd9bc4 /tools/testing/vsock/util.h | |
parent | Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next (diff) | |
download | wireguard-linux-a8ed71a27ef524c808b518031feac811ed3e741c.tar.xz wireguard-linux-a8ed71a27ef524c808b518031feac811ed3e741c.zip |
vsock/test: add recv_buf() utility function
Move the code of recv_byte() out in a new utility function that
can be used to receive a generic buffer.
This new function can be used when we need to receive a custom
buffer and not just a single 'A' byte.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/vsock/util.h')
-rw-r--r-- | tools/testing/vsock/util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/vsock/util.h b/tools/testing/vsock/util.h index fb99208a95ea..fe31f267e67e 100644 --- a/tools/testing/vsock/util.h +++ b/tools/testing/vsock/util.h @@ -42,6 +42,7 @@ int vsock_stream_accept(unsigned int cid, unsigned int port, int vsock_seqpacket_accept(unsigned int cid, unsigned int port, struct sockaddr_vm *clientaddrp); void vsock_wait_remote_close(int fd); +void recv_buf(int fd, void *buf, size_t len, int flags, ssize_t expected_ret); void send_byte(int fd, int expected_ret, int flags); void recv_byte(int fd, int expected_ret, int flags); void run_tests(const struct test_case *test_cases, |