diff options
author | Patrick Mooney <patrick.f.mooney@gmail.com> | 2014-10-28 16:51:43 +0000 |
---|---|---|
committer | Patrick Mooney <patrick.f.mooney@gmail.com> | 2014-10-28 20:42:45 +0000 |
commit | ced2d217a48d19d4f25d73d03a2197089caf6920 (patch) | |
tree | 3033531d80c4f5f23c3ef7c7a9e2770b033d1adb | |
parent | 1a6868414dedd900a9407da82beb9d49927f864e (diff) | |
download | illumos-joyent-ced2d217a48d19d4f25d73d03a2197089caf6920.tar.gz |
OS-3466 lxbrand /proc/sys/kernel/hostname missing
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r-- | usr/src/uts/common/brand/lx/procfs/lx_proc.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/brand/lx/procfs/lx_prvnops.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/usr/src/uts/common/brand/lx/procfs/lx_proc.h b/usr/src/uts/common/brand/lx/procfs/lx_proc.h index d50888d4c6..2d122ebeba 100644 --- a/usr/src/uts/common/brand/lx/procfs/lx_proc.h +++ b/usr/src/uts/common/brand/lx/procfs/lx_proc.h @@ -158,6 +158,7 @@ typedef enum lxpr_nodetype { LXPR_SYS_FS_INOTIFY_MAX_USER_INSTANCES, /* inotify/max_user_instances */ LXPR_SYS_FS_INOTIFY_MAX_USER_WATCHES, /* inotify/max_user_watches */ LXPR_SYS_KERNELDIR, /* /proc/sys/kernel/ */ + LXPR_SYS_KERNEL_HOSTNAME, /* /proc/sys/kernel/hostname */ LXPR_SYS_KERNEL_MSGMNI, /* /proc/sys/kernel/msgmni */ LXPR_SYS_KERNEL_NGROUPS_MAX, /* /proc/sys/kernel/ngroups_max */ LXPR_SYS_KERNEL_PID_MAX, /* /proc/sys/kernel/pid_max */ diff --git a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c index f0a509e850..2b153e5160 100644 --- a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c +++ b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c @@ -66,6 +66,7 @@ #include <sys/pghw.h> #include <sys/vfs_opreg.h> #include <sys/param.h> +#include <sys/utsname.h> /* Dependent on procfs */ extern kthread_t *prchoose(proc_t *); @@ -164,6 +165,7 @@ static void lxpr_read_sys_fs_inotify_max_user_instances(lxpr_node_t *, lxpr_uiobuf_t *); static void lxpr_read_sys_fs_inotify_max_user_watches(lxpr_node_t *, lxpr_uiobuf_t *); +static void lxpr_read_sys_kernel_hostname(lxpr_node_t *, lxpr_uiobuf_t *); static void lxpr_read_sys_kernel_msgmni(lxpr_node_t *, lxpr_uiobuf_t *); static void lxpr_read_sys_kernel_ngroups_max(lxpr_node_t *, lxpr_uiobuf_t *); static void lxpr_read_sys_kernel_pid_max(lxpr_node_t *, lxpr_uiobuf_t *); @@ -311,6 +313,7 @@ static lxpr_dirent_t sys_fs_inotifydir[] = { * contents of /proc/sys/kernel directory */ static lxpr_dirent_t sys_kerneldir[] = { + { LXPR_SYS_KERNEL_HOSTNAME, "hostname" }, { LXPR_SYS_KERNEL_MSGMNI, "msgmni" }, { LXPR_SYS_KERNEL_NGROUPS_MAX, "ngroups_max" }, { LXPR_SYS_KERNEL_PID_MAX, "pid_max" }, @@ -459,6 +462,7 @@ static void (*lxpr_read_function[LXPR_NFILES])() = { lxpr_read_sys_fs_inotify_max_user_instances, /* max_user_instances */ lxpr_read_sys_fs_inotify_max_user_watches, /* max_user_watches */ lxpr_read_invalid, /* /proc/sys/kernel */ + lxpr_read_sys_kernel_hostname, /* /proc/sys/kernel/hostname */ lxpr_read_sys_kernel_msgmni, /* /proc/sys/kernel/msgmni */ lxpr_read_sys_kernel_ngroups_max, /* /proc/sys/kernel/ngroups_max */ lxpr_read_sys_kernel_pid_max, /* /proc/sys/kernel/pid_max */ @@ -530,6 +534,7 @@ static vnode_t *(*lxpr_lookup_function[LXPR_NFILES])() = { lxpr_lookup_not_a_dir, /* .../inotify/max_user_instances */ lxpr_lookup_not_a_dir, /* .../inotify/max_user_watches */ lxpr_lookup_sys_kerneldir, /* /proc/sys/kernel */ + lxpr_lookup_not_a_dir, /* /proc/sys/kernel/hostname */ lxpr_lookup_not_a_dir, /* /proc/sys/kernel/msgmni */ lxpr_lookup_not_a_dir, /* /proc/sys/kernel/ngroups_max */ lxpr_lookup_not_a_dir, /* /proc/sys/kernel/pid_max */ @@ -601,6 +606,7 @@ static int (*lxpr_readdir_function[LXPR_NFILES])() = { lxpr_readdir_not_a_dir, /* .../inotify/max_user_instances */ lxpr_readdir_not_a_dir, /* .../inotify/max_user_watches */ lxpr_readdir_sys_kerneldir, /* /proc/sys/kernel */ + lxpr_readdir_not_a_dir, /* /proc/sys/kernel/hostname */ lxpr_readdir_not_a_dir, /* /proc/sys/kernel/msgmni */ lxpr_readdir_not_a_dir, /* /proc/sys/kernel/ngroups_max */ lxpr_readdir_not_a_dir, /* /proc/sys/kernel/pid_max */ @@ -2117,6 +2123,13 @@ lxpr_read_sys_fs_inotify_max_user_watches(lxpr_node_t *lxpnp, } static void +lxpr_read_sys_kernel_hostname(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf) +{ + ASSERT(lxpnp->lxpr_type == LXPR_SYS_KERNEL_HOSTNAME); + lxpr_uiobuf_printf(uiobuf, "%s\n", uts_nodename()); +} + +static void lxpr_read_sys_kernel_msgmni(lxpr_node_t *lxpnp, lxpr_uiobuf_t *uiobuf) { rctl_qty_t val; |