]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
syscall_wrappers: move unshare()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Oct 2018 11:03:30 +0000 (13:03 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Oct 2018 11:03:30 +0000 (13:03 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/Makefile.am
src/lxc/cmd/lxc_usernsexec.c
src/lxc/criu.c
src/lxc/lxccontainer.c
src/lxc/storage/rsync.c
src/lxc/storage/storage_utils.c
src/lxc/syscall_wrappers.h
src/lxc/utils.h

index 208a485e18efcb278cfaa5c25eadcb510b807bb4..5a0ae9dd4adb6c1a447c53148e3821f69e31b5e1 100644 (file)
@@ -369,6 +369,7 @@ lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
                         macro.h \
                         file_utils.c file_utils.h \
                         string_utils.c string_utils.h \
+                        syscall_wrappers.h \
                         utils.c utils.h
 endif
 
index 7475e750632c9847add3e4407d3373b66adb5113..10557dd5192fb7fd0ac1f48784ac1d92789ce6e2 100644 (file)
@@ -49,6 +49,7 @@
 #include "macro.h"
 #include "file_utils.h"
 #include "string_utils.h"
+#include "syscall_wrappers.h"
 #include "utils.h"
 
 extern int lxc_log_fd;
index 66470a016ab0610bd060412a0c463e52f1dadaee..dcf6d5cf6b51939e23482f6bd2b9240b11366425 100644 (file)
@@ -45,6 +45,7 @@
 #include "lxclock.h"
 #include "network.h"
 #include "storage.h"
+#include "syscall_wrappers.h"
 #include "utils.h"
 
 #if IS_BIONIC
index b4cb4c0ad13348bfa317c504d3a0d0db6502385e..bfd3c85a15f1016ac10862474a58f5f49a92575c 100644 (file)
@@ -73,6 +73,7 @@
 #include "storage/overlay.h"
 #include "storage_utils.h"
 #include "sync.h"
+#include "syscall_wrappers.h"
 #include "terminal.h"
 #include "utils.h"
 #include "version.h"
index e3ade30a0d7f083094cf48a5da3848e9ae5a718d..fa4e59cc30d7e81118f20a1f01fbcb3ff33ddbde 100644 (file)
@@ -38,6 +38,7 @@
 #include "log.h"
 #include "rsync.h"
 #include "storage.h"
+#include "syscall_wrappers.h"
 #include "utils.h"
 
 lxc_log_define(rsync, lxc);
index 36a62a11e92c2ae277d3afb9fa3a2c9bcc037835..9efc939b185272d892b045c1c54adf48f1ebc059 100644 (file)
@@ -48,6 +48,7 @@
 #include "parse.h"
 #include "storage.h"
 #include "storage_utils.h"
+#include "syscall_wrappers.h"
 #include "utils.h"
 
 #ifndef HAVE_STRLCPY
index c2cebe6a840d094376084a08a8c087e04bf76037..8661ceb4f89e008953575adbc90b2e6850ccfd1d 100644 (file)
@@ -155,4 +155,19 @@ static inline int setns(int fd, int nstype)
 }
 #endif
 
+/* Define unshare() if missing from the C library */
+#ifndef HAVE_UNSHARE
+static inline int unshare(int flags)
+{
+#ifdef __NR_unshare
+       return syscall(__NR_unshare, flags);
+#else
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+#else
+extern int unshare(int);
+#endif
+
 #endif /* __LXC_SYSCALL_WRAPPER_H */
index ee3875e58b8c50b80b17b4f0ef5c6af4870f02da..5f16eaedbd02bccd14e29359c1a7cfaee8f68daf 100644 (file)
@@ -56,21 +56,6 @@ extern char *get_rundir(void);
 #endif
 #endif
 
-/* Define unshare() if missing from the C library */
-#ifndef HAVE_UNSHARE
-static inline int unshare(int flags)
-{
-#ifdef __NR_unshare
-       return syscall(__NR_unshare, flags);
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-#else
-extern int unshare(int);
-#endif
-
 /* Define signalfd() if missing from the C library */
 #ifdef HAVE_SYS_SIGNALFD_H
 #  include <sys/signalfd.h>