[v5,13/19] epoll: Add kcmp_epoll check

Submitted by Cyrill Gorcunov on July 4, 2018, 3:51 p.m.

Details

Message ID 20180704155147.29114-14-gorcunov@gmail.com
State Accepted
Series "epoll: Add support for duped targets"
Headers show

Commit Message

Cyrill Gorcunov July 4, 2018, 3:51 p.m.
To run epoll tests only where it is supported.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/cr-check.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/cr-check.c b/criu/cr-check.c
index ff4d9a4bb84b..f534a110515b 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -1110,6 +1110,14 @@  static int check_pid_for_children_ns(void)
 	return 0;
 }
 
+static int check_kcmp_epoll(void)
+{
+	if (!kdat.has_kcmp_epoll_tfd)
+		return -1;
+
+	return 0;
+}
+
 static int (*chk_feature)(void);
 
 /*
@@ -1221,6 +1229,7 @@  int cr_check(void)
 		ret |= check_ns_get_userns();
 		ret |= check_ns_get_parent();
 		ret |= check_pid_for_children_ns();
+		ret |= check_kcmp_epoll();
 	}
 
 	/*
@@ -1309,6 +1318,7 @@  static struct feature_list feature_list[] = {
 	{ "ns_get_userns", check_ns_get_userns },
 	{ "ns_get_parent", check_ns_get_parent },
 	{ "pid_for_children_ns", check_pid_for_children_ns},
+	{ "kcmp_epoll", check_kcmp_epoll},
 	{ NULL, NULL },
 };