From: Christian Brauner Date: Wed, 3 Oct 2018 10:59:32 +0000 (+0200) Subject: syscall_wrappers: move sethostname() X-Git-Tag: lxc-3.1.0~65^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364932cfae36feda321d20574ce25c12519b0f54;p=thirdparty%2Flxc.git syscall_wrappers: move sethostname() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h index b83ff6829..c2cebe6a8 100644 --- a/src/lxc/syscall_wrappers.h +++ b/src/lxc/syscall_wrappers.h @@ -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) diff --git a/src/lxc/utils.h b/src/lxc/utils.h index 5e70dec1a..ee3875e58 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -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)