From 99ac3bc8daec20f7a937487362d15fdf922d8008 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 24 Feb 1996 14:32:53 +0000 Subject: [PATCH] Add two sysctl variables that can be read by libutil and libkvm so that they can adapt to simple kernel VM layout changes. --- sys/kern/kern_exec.c | 13 ++++++++++++- sys/sys/sysctl.h | 8 ++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 1c4c4a44c018..9933183aff40 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.33 1996/01/19 03:58:01 dyson Exp $ + * $Id: kern_exec.c,v 1.34 1996/01/20 21:36:30 bde Exp $ */ #include @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,16 @@ static int *exec_copyout_strings __P((struct image_params *)); static int exec_check_permissions(struct image_params *); +/* + * XXX trouble here if sizeof(caddr_t) != sizeof(int), other parts + * of the sysctl code also assumes this, and sizeof(int) == sizeof(long). + */ +static caddr_t ps_strings = (caddr_t)PS_STRINGS; +SYSCTL_INT(_kern, KERN_PS_STRINGS, ps_strings, 0, &ps_strings, 0, ""); + +static caddr_t usrstack = (caddr_t)USRSTACK; +SYSCTL_INT(_kern, KERN_USRSTACK, usrstack, 0, &usrstack, 0, ""); + /* * execsw_set is constructed for us by the linker. Each of the items * is a pointer to a `const struct execsw', hence the double pointer here. diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 4d6288797fc6..fc52c899e69c 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 - * $Id: sysctl.h,v 1.38 1995/12/09 20:46:06 phk Exp $ + * $Id: sysctl.h,v 1.39 1995/12/17 21:11:12 phk Exp $ */ #ifndef _SYS_SYSCTL_H_ @@ -221,7 +221,9 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS; #define KERN_DUMPDEV 29 /* dev_t: device to dump on */ #define KERN_SOMAXCONN 30 /* int: max connections in listen q */ #define KERN_MAXSOCKBUF 31 /* int: max size of a socket buffer */ -#define KERN_MAXID 32 /* number of valid kern ids */ +#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */ +#define KERN_USRSTACK 33 /* int: address of USRSTACK */ +#define KERN_MAXID 34 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -256,6 +258,8 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS; { "dumpdev", CTLTYPE_STRUCT }, /* we lie; don't print as int */ \ { "somaxconn", CTLTYPE_INT }, \ { "maxsockbuf", CTLTYPE_INT }, \ + { "ps_strings", CTLTYPE_INT }, \ + { "usrstack", CTLTYPE_INT }, \ } /*