]> granicus.if.org Git - strace/commitdiff
tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 14 Jan 2015 12:47:45 +0000 (12:47 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 14 Jan 2015 13:18:05 +0000 (13:18 +0000)
* tests/mmsg.c: #include <errno.h>
(main): Return 77 if sendmmsg failed with ENOSYS.

tests/mmsg.c

index 496111bf230dbfdefc76685430f5278f5bd53586..fddd7d154ffed44c1854ef9cb18810670c5cedf3 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/socket.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <errno.h>
 #include <assert.h>
 
 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);