log.c log.h \
network.c network.h \
parse.c parse.h \
- raw_syscalls.c raw_syscalls.h
+ raw_syscalls.c raw_syscalls.h \
+ syscall_wrappers.h
lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
conf.c conf.h \
list.h \
#include "mainloop.h"
#include "namespace.h"
#include "raw_syscalls.h"
+#include "syscall_wrappers.h"
#include "terminal.h"
#include "utils.h"
#include "network.h"
#include "parse.h"
#include "raw_syscalls.h"
+#include "syscall_wrappers.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "network.h"
#include "nl.h"
#include "raw_syscalls.h"
+#include "syscall_wrappers.h"
#include "utils.h"
#ifndef HAVE_STRLCPY
#include "storage/storage.h"
#include "storage/storage_utils.h"
#include "sync.h"
+#include "syscall_wrappers.h"
#include "terminal.h"
#include "utils.h"
#endif
#include <asm/unistd.h>
#include <linux/keyctl.h>
+#include <sched.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <sys/types.h>
extern int pivot_root(const char *new_root, const char *put_old);
#endif
+#if !defined(__NR_setns) && !defined(__NR_set_ns)
+ #if defined(__x86_64__)
+ #define __NR_setns 308
+ #elif defined(__i386__)
+ #define __NR_setns 346
+ #elif defined(__arm__)
+ #define __NR_setns 375
+ #elif defined(__aarch64__)
+ #define __NR_setns 375
+ #elif defined(__powerpc__)
+ #define __NR_setns 350
+ #elif defined(__s390__)
+ #define __NR_setns 339
+ #endif
+#endif
+
+/* Define setns() if missing from the C library */
+#ifndef HAVE_SETNS
+static inline int setns(int fd, int nstype)
+{
+#ifdef __NR_setns
+ return syscall(__NR_setns, fd, nstype);
+#elif defined(__NR_set_ns)
+ return syscall(__NR_set_ns, fd, nstype);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+#endif
+
#endif /* __LXC_SYSCALL_WRAPPER_H */
#endif
#endif
-#if !defined(__NR_setns) && !defined(__NR_set_ns)
- #if defined(__x86_64__)
- #define __NR_setns 308
- #elif defined(__i386__)
- #define __NR_setns 346
- #elif defined(__arm__)
- #define __NR_setns 375
- #elif defined(__aarch64__)
- #define __NR_setns 375
- #elif defined(__powerpc__)
- #define __NR_setns 350
- #elif defined(__s390__)
- #define __NR_setns 339
- #endif
-#endif
-
-/* Define setns() if missing from the C library */
-#ifndef HAVE_SETNS
-static inline int setns(int fd, int nstype)
-{
-#ifdef __NR_setns
- return syscall(__NR_setns, fd, nstype);
-#elif defined(__NR_set_ns)
- return syscall(__NR_set_ns, fd, nstype);
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
-#endif
-
/* Define sethostname() if missing from the C library */
#ifndef HAVE_SETHOSTNAME
static inline int sethostname(const char *name, size_t len)