From: Stéphane Graber Date: Fri, 7 Feb 2014 20:21:24 +0000 (-0500) Subject: bionic: Define faccessat if missing X-Git-Tag: lxc-1.0.0.rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f7eba0b1c5b344c7f78ed5dce8b338f139771d6;p=thirdparty%2Flxc.git bionic: Define faccessat if missing Signed-off-by: Stéphane Graber --- diff --git a/configure.ac b/configure.ac index 07cdbf9bb..b07ac143b 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include ]) AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h]) # Check for some syscalls functions -AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr]) +AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat]) # Check for some functions AC_CHECK_LIB(pthread, main) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index ac92bf10e..cbd645d84 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -65,6 +66,20 @@ #define NOT_SUPPORTED_ERROR "the requested function %s is not currently supported with unprivileged containers" +/* Define faccessat() if missing from the C library */ +#ifndef HAVE_FACCESSAT +static int faccessat(int __fd, const char *__file, int __type, int __flag) +{ +#ifdef __NR_faccessat +return syscall(__NR_faccessat, __fd, __file, __type, __flag); +#else +errno = ENOSYS; +return -1; +#endif +} +#endif + + lxc_log_define(lxc_container, lxc); static bool file_exists(const char *f)