Date: Thu, 13 Aug 2020 19:03:32 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364215 - stable/12/sys/compat/linprocfs Message-ID: <202008131903.07DJ3WsI006481@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Thu Aug 13 19:03:32 2020 New Revision: 364215 URL: https://svnweb.freebsd.org/changeset/base/364215 Log: MFC r363303: Add missing SysV IPC stats to linprocfs(4). Fixes 'ipcs -l', and also helps Oracle. Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/12/sys/compat/linprocfs/linprocfs.c Thu Aug 13 19:02:11 2020 (r364214) +++ stable/12/sys/compat/linprocfs/linprocfs.c Thu Aug 13 19:03:32 2020 (r364215) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include <sys/resource.h> #include <sys/sbuf.h> #include <sys/sem.h> +#include <sys/shm.h> #include <sys/smp.h> #include <sys/socket.h> #include <sys/syscallsubr.h> @@ -1419,6 +1420,17 @@ linprocfs_doosbuild(PFS_FILL_ARGS) } /* + * Filler function for proc/sys/kernel/msgmax + */ +static int +linprocfs_domsgmax(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", msginfo.msgmax); + return (0); +} + +/* * Filler function for proc/sys/kernel/msgmni */ static int @@ -1430,6 +1442,17 @@ linprocfs_domsgmni(PFS_FILL_ARGS) } /* + * Filler function for proc/sys/kernel/msgmnb + */ +static int +linprocfs_domsgmnb(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%d\n", msginfo.msgmnb); + return (0); +} + +/* * Filler function for proc/sys/kernel/pid_max */ static int @@ -1453,6 +1476,39 @@ linprocfs_dosem(PFS_FILL_ARGS) } /* + * Filler function for proc/sys/kernel/shmall + */ +static int +linprocfs_doshmall(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%lu\n", shminfo.shmall); + return (0); +} + +/* + * Filler function for proc/sys/kernel/shmmax + */ +static int +linprocfs_doshmmax(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%lu\n", shminfo.shmmax); + return (0); +} + +/* + * Filler function for proc/sys/kernel/shmmni + */ +static int +linprocfs_doshmmni(PFS_FILL_ARGS) +{ + + sbuf_printf(sb, "%lu\n", shminfo.shmmni); + return (0); +} + +/* * Filler function for proc/sys/kernel/tainted */ static int @@ -1851,6 +1907,7 @@ linprocfs_init(PFS_INIT_ARGS) /* /proc/sys/... */ sys = pfs_create_dir(root, "sys", NULL, NULL, NULL, 0); + /* /proc/sys/kernel/... */ dir = pfs_create_dir(sys, "kernel", NULL, NULL, NULL, 0); pfs_create_file(dir, "osrelease", &linprocfs_doosrelease, @@ -1859,12 +1916,22 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "version", &linprocfs_doosbuild, NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "msgmax", &linprocfs_domsgmax, + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "msgmni", &linprocfs_domsgmni, NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "msgmnb", &linprocfs_domsgmnb, + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "pid_max", &linprocfs_dopid_max, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "sem", &linprocfs_dosem, NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "shmall", &linprocfs_doshmall, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "shmmax", &linprocfs_doshmmax, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(dir, "shmmni", &linprocfs_doshmmni, + NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "tainted", &linprocfs_dotainted, NULL, NULL, NULL, PFS_RD); @@ -1901,3 +1968,4 @@ MODULE_DEPEND(linprocfs, linux, 1, 1, 1); MODULE_DEPEND(linprocfs, procfs, 1, 1, 1); MODULE_DEPEND(linprocfs, sysvmsg, 1, 1, 1); MODULE_DEPEND(linprocfs, sysvsem, 1, 1, 1); +MODULE_DEPEND(linprocfs, sysvshm, 1, 1, 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008131903.07DJ3WsI006481>