mirror of
https://sourceware.org/git/glibc.git
synced 2025-04-26 15:09:05 +03:00
tst-process_madvise: Check process_madvise-syscall support.
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>
This commit is contained in:
parent
61d2066c19
commit
11f09947f3
@ -101,8 +101,11 @@ do_test (void)
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user