]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
syscall_wrappers: move sethostname()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Oct 2018 10:59:32 +0000 (12:59 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 3 Oct 2018 11:00:21 +0000 (13:00 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/syscall_wrappers.h
src/lxc/utils.h

index b83ff68294d3b6446bba48a4c4396a2bc9bd1358..c2cebe6a840d094376084a08a8c087e04bf76037 100644 (file)
@@ -127,6 +127,19 @@ extern int pivot_root(const char *new_root, const char *put_old);
        #endif
 #endif
 
+/* Define sethostname() if missing from the C library */
+#ifndef HAVE_SETHOSTNAME
+static inline int sethostname(const char *name, size_t len)
+{
+#ifdef __NR_sethostname
+       return syscall(__NR_sethostname, name, len);
+#else
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+#endif
+
 /* Define setns() if missing from the C library */
 #ifndef HAVE_SETNS
 static inline int setns(int fd, int nstype)
index 5e70dec1a1bc05fd8c4f7d724ab380ad5ce6223a..ee3875e58b8c50b80b17b4f0ef5c6af4870f02da 100644 (file)
@@ -56,19 +56,6 @@ extern char *get_rundir(void);
 #endif
 #endif
 
-/* Define sethostname() if missing from the C library */
-#ifndef HAVE_SETHOSTNAME
-static inline int sethostname(const char *name, size_t len)
-{
-#ifdef __NR_sethostname
-return syscall(__NR_sethostname, name, len);
-#else
-errno = ENOSYS;
-return -1;
-#endif
-}
-#endif
-
 /* Define unshare() if missing from the C library */
 #ifndef HAVE_UNSHARE
 static inline int unshare(int flags)