Make UAREA_PAGES and KSTACK_PAGES visible to userland via sysctl, like

PS_STRINGS and USRSTACK is.  This is necessary in order to decode a.out
core dumps.  kern_proc.c was already referring to both of these values
but was missing the #include "opt_kstack_pages.h".  Make the sysctl
variables visible so that certain kld modules can see how their parent
kernel was configured.
This commit is contained in:
peter 2002-09-07 22:11:45 +00:00
parent a054ba3c90
commit 93d34a10ac
2 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,7 @@
*/
#include "opt_ktrace.h"
#include "opt_kstack_pages.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -101,6 +102,11 @@ static int active_procs;
static int cached_procs;
static int allocated_procs;
int kstack_pages = KSTACK_PAGES;
int uarea_pages = UAREA_PAGES;
SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "");
SYSCTL_INT(_kern, OID_AUTO, uarea_pages, CTLFLAG_RD, &uarea_pages, 0, "");
#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start))
CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE);

View File

@ -54,6 +54,8 @@ extern int cold; /* nonzero if we are doing a cold boot */
extern const char *panicstr; /* panic message */
extern char version[]; /* system version */
extern char copyright[]; /* system copyright */
extern int kstack_pages; /* number of kernel stack pages */
extern int uarea_pages; /* number of user struct pages */
extern int nswap; /* size of swap space */