From 95cbf6ebfdbf4739fb9c65d46487cb0210b539a4 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 14 Jan 2015 12:47:45 +0000 Subject: [PATCH] tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel * tests/mmsg.c: #include (main): Return 77 if sendmmsg failed with ENOSYS. --- tests/mmsg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/mmsg.c b/tests/mmsg.c index 496111bf..fddd7d15 100644 --- a/tests/mmsg.c +++ b/tests/mmsg.c @@ -4,6 +4,7 @@ #include #include #include +#include #include int @@ -61,7 +62,10 @@ main(void) assert(dup2(sv[R], R) == R); assert(close(sv[R]) == 0); - assert(sendmmsg(W, mmh, n_mmh, 0) == n_mmh); + int r = sendmmsg(W, mmh, n_mmh, 0); + if (r < 0 && errno == ENOSYS) + return 77; + assert((size_t)r == n_mmh); assert(close(W) == 0); assert(recvmmsg(R, mmh, n_mmh, 0, NULL) == n_mmh); -- 2.40.0