]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
syscalls: add fspick()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 22 Jul 2020 08:54:12 +0000 (10:54 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 23 Jul 2020 08:20:50 +0000 (10:20 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
configure.ac
src/lxc/syscall_numbers.h
src/lxc/syscall_wrappers.h

index 85d2668850692cf28f4b27ca80f387c6389055bb..32fcdc230dc82c4e492e8579ea44a78bca4d6830 100644 (file)
@@ -622,7 +622,7 @@ AC_CHECK_HEADER([ifaddrs.h],
 AC_HEADER_MAJOR
 
 # Check for some syscalls functions
-AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create move_mount open_tree execveat clone3 fsopen])
+AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create move_mount open_tree execveat clone3 fsopen fspick])
 AC_CHECK_TYPES([struct clone_args], [], [], [[#include <linux/sched.h>]])
 AC_CHECK_MEMBERS([struct clone_args.set_tid],[],[],[[#include <linux/sched.h>]])
 AC_CHECK_MEMBERS([struct clone_args.cgroup],[],[],[[#include <linux/sched.h>]])
index 678683092420d399ad72639d829487e17a8bb890..cbd69803ea9c583e20ea388e3cb4cf80c30980bb 100644 (file)
        #endif
 #endif
 
+#ifndef __NR_fspick
+       #if defined __alpha__
+               #define __NR_fspick 543
+       #elif defined _MIPS_SIM
+               #if _MIPS_SIM == _MIPS_SIM_ABI32        /* o32 */
+                       #define __NR_fspick 4433
+               #endif
+               #if _MIPS_SIM == _MIPS_SIM_NABI32       /* n32 */
+                       #define __NR_fspick 6433
+               #endif
+               #if _MIPS_SIM == _MIPS_SIM_ABI64        /* n64 */
+                       #define __NR_fspick 5433
+               #endif
+       #elif defined __ia64__
+               #define __NR_fspick (433 + 1024)
+       #else
+               #define __NR_fspick 433
+       #endif
+#endif
+
 #endif /* __LXC_SYSCALL_NUMBERS_H */
index 8e7937d4d410903088f571a0cef94163dff4e705..6d4f8f42cdbb6053ac1c292c638608ff30c93504 100644 (file)
@@ -171,4 +171,14 @@ static inline int fsopen_lxc(const char *fs_name, unsigned int flags)
 extern int fsopen(const char *fs_name, unsigned int flags);
 #endif
 
+#ifndef HAVE_FSPICK
+static inline int fspick_lxc(int dfd, const char *path, unsigned int flags)
+{
+       return syscall(__NR_fspick, dfd, path, flags);
+}
+#define fspick fspick_lxc
+#else
+extern int fspick(int dfd, const char *path, unsigned int flags);
+#endif
+
 #endif /* __LXC_SYSCALL_WRAPPER_H */