From: Dmitry V. Levin Date: Wed, 14 Jan 2015 12:47:45 +0000 (+0000) Subject: tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel X-Git-Tag: v4.10~191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95cbf6ebfdbf4739fb9c65d46487cb0210b539a4;p=strace 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. --- 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);