rteval-loads/SOURCES/0003-stress-sock-add-a-few-more-ioctls-to-exercise.patch
2022-02-03 05:25:13 +00:00

74 lines
1.4 KiB
Diff

From f4fd8ae1f02e76ff7e7020cab9b5204baf91ec81 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Sun, 17 May 2020 18:37:59 +0100
Subject: [PATCH 03/28] stress-sock: add a few more ioctls to exercise
improve kernel socket ioctl coverage by adding a few more ioctls
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
stress-sock.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/stress-sock.c b/stress-sock.c
index 031e84d98244..beafc46e2469 100644
--- a/stress-sock.c
+++ b/stress-sock.c
@@ -151,6 +151,44 @@ static int stress_set_socket_domain(const char *name)
return ret;
}
+static void stress_sock_ioctl(const int fd)
+{
+#if defined(FIOGETOWN)
+ {
+ int ret, own;
+
+ ret = ioctl(fd, FIOGETOWN, &own);
+ (void)ret;
+ }
+#endif
+#if defined(SIOCGPGRP)
+ {
+ int ret, own;
+
+ ret = ioctl(fd, SIOCGPGRP, &own);
+ (void)ret;
+ }
+#endif
+#if defined(SIOCGIFCONF)
+ {
+ int ret;
+ struct ifconf ifc;
+
+ ret = ioctl(fd, SIOCGIFCONF, &ifc);
+ (void)ret;
+ }
+#endif
+#if defined(SIOCGSTAMP)
+ {
+ int ret;
+ struct timeval tv;
+
+ ret = ioctl(fd, SIOCGSTAMP, &tv);
+ (void)ret;
+ }
+#endif
+}
+
/*
* stress_sock_client()
* client reader
@@ -324,6 +362,8 @@ retry:
break;
}
} while (keep_stressing());
+
+ stress_sock_ioctl(fd);
#if defined(AF_INET) && \
defined(IPPROTO_IP) && \
defined(IP_MTU)
--
2.21.3