Add two sysctl variables that can be read by libutil and libkvm so that

they can adapt to simple kernel VM layout changes.
This commit is contained in:
Peter Wemm 1996-02-24 14:32:53 +00:00
parent d2165a8da6
commit 99ac3bc8da
2 changed files with 18 additions and 3 deletions

View File

@ -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 <sys/param.h>
@ -47,6 +47,7 @@
#include <sys/sysent.h>
#include <sys/syslog.h>
#include <sys/shm.h>
#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
@ -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.

View File

@ -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 }, \
}
/*