Commit 9e3f1c59 authored by Hu.Yadi's avatar Hu.Yadi Committed by Christian Brauner

selftests/move_mount_set_group:Make tests build with old libc

Replace SYS_<syscall> with __NR_<syscall>.  Using the __NR_<syscall>
notation, provided by UAPI, is useful to build tests on systems without
the SYS_<syscall> definitions.

Replace SYS_move_mount with __NR_move_mount

Similar changes: commit 87129ef1 ("selftests/landlock: Make tests build with old libc")
Acked-by: default avatarMickaël Salaün <mic@digikod.net>
Signed-off-by: default avatarHu.Yadi <hu.yadi@h3c.com>
Link: https://lore.kernel.org/r/20240111113229.10820-1-hu.yadi@h3c.comReviewed-by: default avatarBerlin <berlin@h3c.com>
Suggested-by: default avatarJiao <jiaoxupo@h3c.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 0f05ee44
...@@ -218,7 +218,7 @@ static bool move_mount_set_group_supported(void) ...@@ -218,7 +218,7 @@ static bool move_mount_set_group_supported(void)
if (mount(NULL, SET_GROUP_FROM, NULL, MS_SHARED, 0)) if (mount(NULL, SET_GROUP_FROM, NULL, MS_SHARED, 0))
return -1; return -1;
ret = syscall(SYS_move_mount, AT_FDCWD, SET_GROUP_FROM, ret = syscall(__NR_move_mount, AT_FDCWD, SET_GROUP_FROM,
AT_FDCWD, SET_GROUP_TO, MOVE_MOUNT_SET_GROUP); AT_FDCWD, SET_GROUP_TO, MOVE_MOUNT_SET_GROUP);
umount2("/tmp", MNT_DETACH); umount2("/tmp", MNT_DETACH);
...@@ -363,7 +363,7 @@ TEST_F(move_mount_set_group, complex_sharing_copying) ...@@ -363,7 +363,7 @@ TEST_F(move_mount_set_group, complex_sharing_copying)
CLONE_VM | CLONE_FILES); ASSERT_GT(pid, 0); CLONE_VM | CLONE_FILES); ASSERT_GT(pid, 0);
ASSERT_EQ(wait_for_pid(pid), 0); ASSERT_EQ(wait_for_pid(pid), 0);
ASSERT_EQ(syscall(SYS_move_mount, ca_from.mntfd, "", ASSERT_EQ(syscall(__NR_move_mount, ca_from.mntfd, "",
ca_to.mntfd, "", MOVE_MOUNT_SET_GROUP ca_to.mntfd, "", MOVE_MOUNT_SET_GROUP
| MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH), | MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH),
0); 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment