mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
selftests: pidfd: skip test on kcmp() ENOSYS
Skip test if kcmp() is not available, for example if kernel is compiled without CONFIG_CHECKPOINT_RESTORE=y. Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
0b18fed98b
commit
b5ec9fe5be
@ -204,7 +204,10 @@ TEST_F(child, fetch_fd)
|
||||
fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0);
|
||||
ASSERT_GE(fd, 0);
|
||||
|
||||
EXPECT_EQ(0, sys_kcmp(getpid(), self->pid, KCMP_FILE, fd, self->remote_fd));
|
||||
ret = sys_kcmp(getpid(), self->pid, KCMP_FILE, fd, self->remote_fd);
|
||||
if (ret < 0 && errno == ENOSYS)
|
||||
SKIP(return, "kcmp() syscall not supported");
|
||||
EXPECT_EQ(ret, 0);
|
||||
|
||||
ret = fcntl(fd, F_GETFD);
|
||||
ASSERT_GE(ret, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user