Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 87129ef13603 ("selftests/landlock: Make tests build with old libc")

Acked-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Hu.Yadi <hu.yadi@h3c.com>
Link: https://lore.kernel.org/r/20240111113229.10820-1-hu.yadi@h3c.com
Reviewed-by: Berlin <berlin@h3c.com>
Suggested-by: Jiao <jiaoxupo@h3c.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Hu.Yadi and committed by
Christian Brauner
9e3f1c59 0f05ee44

+2 -2
+2 -2
tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c
··· 218 218 if (mount(NULL, SET_GROUP_FROM, NULL, MS_SHARED, 0)) 219 219 return -1; 220 220 221 - ret = syscall(SYS_move_mount, AT_FDCWD, SET_GROUP_FROM, 221 + ret = syscall(__NR_move_mount, AT_FDCWD, SET_GROUP_FROM, 222 222 AT_FDCWD, SET_GROUP_TO, MOVE_MOUNT_SET_GROUP); 223 223 umount2("/tmp", MNT_DETACH); 224 224 ··· 363 363 CLONE_VM | CLONE_FILES); ASSERT_GT(pid, 0); 364 364 ASSERT_EQ(wait_for_pid(pid), 0); 365 365 366 - ASSERT_EQ(syscall(SYS_move_mount, ca_from.mntfd, "", 366 + ASSERT_EQ(syscall(__NR_move_mount, ca_from.mntfd, "", 367 367 ca_to.mntfd, "", MOVE_MOUNT_SET_GROUP 368 368 | MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH), 369 369 0);