signal: Fix sending signals with siginfo
[cris-mirror.git] / include / linux / utsname.h
blob60f0bb83b313af0e5429264bb83296735c8cdf01
1 #ifndef _LINUX_UTSNAME_H
2 #define _LINUX_UTSNAME_H
5 #include <linux/sched.h>
6 #include <linux/kref.h>
7 #include <linux/nsproxy.h>
8 #include <linux/ns_common.h>
9 #include <linux/err.h>
10 #include <uapi/linux/utsname.h>
12 enum uts_proc {
13 UTS_PROC_OSTYPE,
14 UTS_PROC_OSRELEASE,
15 UTS_PROC_VERSION,
16 UTS_PROC_HOSTNAME,
17 UTS_PROC_DOMAINNAME,
20 struct user_namespace;
21 extern struct user_namespace init_user_ns;
23 struct uts_namespace {
24 struct kref kref;
25 struct new_utsname name;
26 struct user_namespace *user_ns;
27 struct ucounts *ucounts;
28 struct ns_common ns;
30 extern struct uts_namespace init_uts_ns;
32 #ifdef CONFIG_UTS_NS
33 static inline void get_uts_ns(struct uts_namespace *ns)
35 kref_get(&ns->kref);
38 extern struct uts_namespace *copy_utsname(unsigned long flags,
39 struct user_namespace *user_ns, struct uts_namespace *old_ns);
40 extern void free_uts_ns(struct kref *kref);
42 static inline void put_uts_ns(struct uts_namespace *ns)
44 kref_put(&ns->kref, free_uts_ns);
46 #else
47 static inline void get_uts_ns(struct uts_namespace *ns)
51 static inline void put_uts_ns(struct uts_namespace *ns)
55 static inline struct uts_namespace *copy_utsname(unsigned long flags,
56 struct user_namespace *user_ns, struct uts_namespace *old_ns)
58 if (flags & CLONE_NEWUTS)
59 return ERR_PTR(-EINVAL);
61 return old_ns;
63 #endif
65 #ifdef CONFIG_PROC_SYSCTL
66 extern void uts_proc_notify(enum uts_proc proc);
67 #else
68 static inline void uts_proc_notify(enum uts_proc proc)
71 #endif
73 static inline struct new_utsname *utsname(void)
75 return &current->nsproxy->uts_ns->name;
78 static inline struct new_utsname *init_utsname(void)
80 return &init_uts_ns.name;
83 extern struct rw_semaphore uts_sem;
85 #endif /* _LINUX_UTSNAME_H */