]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - include/namespace.h
1 /* Compat code so unshare and setns can be used with older libcs */
2 #ifndef UTIL_LINUX_NAMESPACE_H
3 # define UTIL_LINUX_NAMESPACE_H
8 # define CLONE_NEWNS 0x00020000
11 # define CLONE_NEWUTS 0x04000000
14 # define CLONE_NEWIPC 0x08000000
17 # define CLONE_NEWNET 0x40000000
19 # ifndef CLONE_NEWUSER
20 # define CLONE_NEWUSER 0x10000000
23 # define CLONE_NEWPID 0x20000000
26 # if !defined(HAVE_UNSHARE) || !defined(HAVE_SETNS)
27 # include <sys/syscall.h>
30 # if !defined(HAVE_UNSHARE) && defined(SYS_unshare)
31 static inline int unshare(int flags
)
33 return syscall(SYS_unshare
, flags
);
37 # if !defined(HAVE_SETNS) && defined(SYS_setns)
38 static inline int setns(int fd
, int nstype
)
40 return syscall(SYS_setns
, fd
, nstype
);
44 #endif /* UTIL_LINUX_NAMESPACE_H */