From: Christian Brauner Date: Wed, 22 Jul 2020 08:59:49 +0000 (+0200) Subject: syscalls: add fsconfig() X-Git-Tag: lxc-5.0.0~383^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9edfcaa8220c1d80a91646e0286ae1aa0da7957b;p=thirdparty%2Flxc.git syscalls: add fsconfig() Signed-off-by: Christian Brauner --- diff --git a/configure.ac b/configure.ac index 32fcdc230..8178a4452 100644 --- a/configure.ac +++ b/configure.ac @@ -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 fspick]) +AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create move_mount open_tree execveat clone3 fsopen fspick fsconfig]) AC_CHECK_TYPES([struct clone_args], [], [], [[#include ]]) AC_CHECK_MEMBERS([struct clone_args.set_tid],[],[],[[#include ]]) AC_CHECK_MEMBERS([struct clone_args.cgroup],[],[],[[#include ]]) diff --git a/src/lxc/syscall_numbers.h b/src/lxc/syscall_numbers.h index cbd69803e..0cc2d6742 100644 --- a/src/lxc/syscall_numbers.h +++ b/src/lxc/syscall_numbers.h @@ -603,4 +603,24 @@ #endif #endif +#ifndef __NR_fsconfig + #if defined __alpha__ + #define __NR_fsconfig 541 + #elif defined _MIPS_SIM + #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ + #define __NR_fsconfig 4431 + #endif + #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ + #define __NR_fsconfig 6431 + #endif + #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ + #define __NR_fsconfig 5431 + #endif + #elif defined __ia64__ + #define __NR_fsconfig (431 + 1024) + #else + #define __NR_fsconfig 431 + #endif +#endif + #endif /* __LXC_SYSCALL_NUMBERS_H */ diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h index 6d4f8f42c..aeb1db8ac 100644 --- a/src/lxc/syscall_wrappers.h +++ b/src/lxc/syscall_wrappers.h @@ -181,4 +181,14 @@ static inline int fspick_lxc(int dfd, const char *path, unsigned int flags) extern int fspick(int dfd, const char *path, unsigned int flags); #endif +#ifndef HAVE_FSCONFIG +static inline int fsconfig_lxc(int fd, unsigned int cmd, const char *key, const void *value, int aux) +{ + return syscall(__NR_fsconfig, fd, cmd, key, value, aux); +} +#define fsconfig fsconfig_lxc +#else +extern int fsconfig(int fd, unsigned int cmd, const char *key, const void *value, int aux); +#endif + #endif /* __LXC_SYSCALL_WRAPPER_H */