Signed-off-by: Karel Zak <kzak@redhat.com>
# define CLONE_NEWPID 0x20000000
# endif
-# ifndef HAVE_UNSHARE
+# if !defined(HAVE_UNSHARE) || !defined(HAVE_SETNS)
# include <sys/syscall.h>
+# endif
+
+# ifndef HAVE_UNSHARE
static inline int unshare(int flags)
{
return syscall(SYS_unshare, flags);
# endif
# ifndef HAVE_SETNS
-# include <sys/syscall.h>
static inline int setns(int fd, int nstype)
{
return syscall(SYS_setns, fd, nstype);
#include <sys/stat.h>
#include <sys/ioctl.h>
#ifdef __linux__
-# include <sys/vt.h>
-# include <sys/kd.h>
-# include <linux/serial.h>
+# include <sys/vt.h>
+# include <sys/kd.h>
+# include <linux/serial.h>
+# include <linux/major.h>
#endif
#include <fcntl.h>
#include <dirent.h>
# include <sys/mount.h>
# include <linux/fs.h>
# include <linux/magic.h>
-# include <linux/major.h>
# ifndef MNT_DETACH
# define MNT_DETACH 2
# endif
#include "canonicalize.h"
#include "sulogin-consoles.h"
-#ifdef __linux__
-# include <linux/major.h>
-#endif
-
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
# ifndef typeof
# define typeof __typeof__
#include <time.h>
#include <sys/file.h>
#include <sys/socket.h>
-#include <netdb.h>
#include <langinfo.h>
#include <grp.h>
#include <arpa/inet.h>