~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/utsname.h

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _LINUX_UTSNAME_H
  2 #define _LINUX_UTSNAME_H
  3 
  4 
  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>
 11 
 12 enum uts_proc {
 13         UTS_PROC_OSTYPE,
 14         UTS_PROC_OSRELEASE,
 15         UTS_PROC_VERSION,
 16         UTS_PROC_HOSTNAME,
 17         UTS_PROC_DOMAINNAME,
 18 };
 19 
 20 struct user_namespace;
 21 extern struct user_namespace init_user_ns;
 22 
 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;
 29 };
 30 extern struct uts_namespace init_uts_ns;
 31 
 32 #ifdef CONFIG_UTS_NS
 33 static inline void get_uts_ns(struct uts_namespace *ns)
 34 {
 35         kref_get(&ns->kref);
 36 }
 37 
 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);
 41 
 42 static inline void put_uts_ns(struct uts_namespace *ns)
 43 {
 44         kref_put(&ns->kref, free_uts_ns);
 45 }
 46 #else
 47 static inline void get_uts_ns(struct uts_namespace *ns)
 48 {
 49 }
 50 
 51 static inline void put_uts_ns(struct uts_namespace *ns)
 52 {
 53 }
 54 
 55 static inline struct uts_namespace *copy_utsname(unsigned long flags,
 56         struct user_namespace *user_ns, struct uts_namespace *old_ns)
 57 {
 58         if (flags & CLONE_NEWUTS)
 59                 return ERR_PTR(-EINVAL);
 60 
 61         return old_ns;
 62 }
 63 #endif
 64 
 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)
 69 {
 70 }
 71 #endif
 72 
 73 static inline struct new_utsname *utsname(void)
 74 {
 75         return &current->nsproxy->uts_ns->name;
 76 }
 77 
 78 static inline struct new_utsname *init_utsname(void)
 79 {
 80         return &init_uts_ns.name;
 81 }
 82 
 83 extern struct rw_semaphore uts_sem;
 84 
 85 #endif /* _LINUX_UTSNAME_H */
 86 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp