1 #ifndef _LINUX_UTSNAME_H
2 #define _LINUX_UTSNAME_H
4 #include <linux/sched.h>
5 #include <linux/kref.h>
6 #include <linux/nsproxy.h>
7 #include <asm/atomic.h>
9 #define __OLD_UTS_LEN 8
11 struct oldold_utsname {
19 #define __NEW_UTS_LEN 64
38 struct uts_namespace {
40 struct new_utsname name;
42 extern struct uts_namespace init_uts_ns;
44 static inline void get_uts_ns(struct uts_namespace *ns)
50 extern int unshare_utsname(unsigned long unshare_flags,
51 struct uts_namespace **new_uts);
52 extern int copy_utsname(int flags, struct task_struct *tsk);
53 extern void free_uts_ns(struct kref *kref);
55 static inline void put_uts_ns(struct uts_namespace *ns)
57 kref_put(&ns->kref, free_uts_ns);
60 static inline int unshare_utsname(unsigned long unshare_flags,
61 struct uts_namespace **new_uts)
63 if (unshare_flags & CLONE_NEWUTS)
69 static inline int copy_utsname(int flags, struct task_struct *tsk)
73 static inline void put_uts_ns(struct uts_namespace *ns)
78 static inline struct new_utsname *utsname(void)
80 return ¤t->nsproxy->uts_ns->name;
83 static inline struct new_utsname *init_utsname(void)
85 return &init_uts_ns.name;
88 extern struct rw_semaphore uts_sem;