]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
missing: move sys_execveat() to missing.h
authorChristian Brauner <brauner@kernel.org>
Thu, 12 May 2022 16:52:45 +0000 (18:52 +0200)
committerZorro Lang <zlang@kernel.org>
Sun, 15 May 2022 01:02:40 +0000 (09:02 +0800)
The missing.h header provides syscalls potentially missing from the used
libc. Move the sys_execveat() definition into it. It doesn't belong into
vfstest.c.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/vfs/missing.h
src/vfs/vfstest.c

index c4f4cc320eee9acfa250af9d7ed6ae627802e7cc..059e742d7f431e8f7c5fb7132e161e2875c4764c 100644 (file)
@@ -148,4 +148,15 @@ static inline int sys_umount2(const char *path, int flags)
        return syscall(__NR_umount2, path, flags);
 }
 
+static inline int sys_execveat(int fd, const char *path, char **argv,
+                              char **envp, int flags)
+{
+#ifdef __NR_execveat
+       return syscall(__NR_execveat, fd, path, argv, envp, flags);
+#else
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+
 #endif /* __IDMAP_MISSING_H */
index 8a68565c55443548b7fc1aad65b6239080c1d184..1d71b25befdaed2fdc022232d909cb1cd86d2db8 100644 (file)
@@ -226,17 +226,6 @@ __attribute__((unused)) static int print_r(int fd, const char *path)
 }
 #endif
 
-static int sys_execveat(int fd, const char *path, char **argv, char **envp,
-                       int flags)
-{
-#ifdef __NR_execveat
-       return syscall(__NR_execveat, fd, path, argv, envp, flags);
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-
 static void test_setup(struct vfstest_info *info)
 {
        if (mkdirat(info->t_mnt_fd, T_DIR1, 0777))