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 copy_utsname(int flags, struct task_struct *tsk);
51 extern void free_uts_ns(struct kref *kref);
53 static inline void put_uts_ns(struct uts_namespace *ns)
55 kref_put(&ns->kref, free_uts_ns);
58 static inline int copy_utsname(int flags, struct task_struct *tsk)
62 static inline void put_uts_ns(struct uts_namespace *ns)
67 static inline struct new_utsname *utsname(void)
69 return ¤t->nsproxy->uts_ns->name;
72 static inline struct new_utsname *init_utsname(void)
74 return &init_uts_ns.name;
77 extern struct rw_semaphore uts_sem;