tests: skip sendmmsg/recvmmsg test if these syscalls are not implemented in kernel

* tests/mmsg.c: #include <errno.h>
(main): Return 77 if sendmmsg failed with ENOSYS.
This commit is contained in:
Дмитрий Левин 2015-01-14 12:47:45 +00:00
parent 552bc3a09a
commit 95cbf6ebfd

View 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);