Commit 5f7eba0b by Stéphane Graber

bionic: Define faccessat if missing

parent d5aa23e6
...@@ -515,7 +515,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) ...@@ -515,7 +515,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h]) 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 # 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 # Check for some functions
AC_CHECK_LIB(pthread, main) AC_CHECK_LIB(pthread, main)
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <libgen.h> #include <libgen.h>
#include <stdint.h> #include <stdint.h>
#include <grp.h> #include <grp.h>
#include <sys/syscall.h>
#include <lxc/lxccontainer.h> #include <lxc/lxccontainer.h>
#include <lxc/version.h> #include <lxc/version.h>
...@@ -65,6 +66,20 @@ ...@@ -65,6 +66,20 @@
#define NOT_SUPPORTED_ERROR "the requested function %s is not currently supported with unprivileged containers" #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); lxc_log_define(lxc_container, lxc);
static bool file_exists(const char *f) static bool file_exists(const char *f)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment