So far this test checks if pidfd_open-syscall is supported,
which was introduced with linux 5.3.
The process_madvise-syscall was introduced with linux 5.10.
Thus you'll get FAILs if you are running a kernel in between.
This patch adds a check if the first process_madvise-syscall
returns ENOSYS and in this case will fail with UNSUPPORTED.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
/* We expect this to succeed in the target process because the mapping
is valid. */
- TEST_COMPARE (process_madvise (pidfd, &iv, 1, MADV_COLD, 0),
- 2 * page_size);
+ ssize_t ret = process_madvise (pidfd, &iv, 1, MADV_COLD, 0);
+ if (ret == -1 && errno == ENOSYS)
+ FAIL_UNSUPPORTED ("kernel does not support process_madvise, skipping"
+ "test");
+ TEST_COMPARE (ret, 2 * page_size);
}
{