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)
#include <libgen.h>
#include <stdint.h>
#include <grp.h>
+#include <sys/syscall.h>
#include <lxc/lxccontainer.h>
#include <lxc/version.h>
#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)