kern_mib.c revision 170071
115103Sphk/*-
215103Sphk * Copyright (c) 1982, 1986, 1989, 1993
315103Sphk *	The Regents of the University of California.  All rights reserved.
415103Sphk *
515103Sphk * This code is derived from software contributed to Berkeley by
615103Sphk * Mike Karels at Berkeley Software Design, Inc.
715103Sphk *
815103Sphk * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
915103Sphk * project, to make these variables more userfriendly.
1015103Sphk *
1115103Sphk * Redistribution and use in source and binary forms, with or without
1215103Sphk * modification, are permitted provided that the following conditions
1315103Sphk * are met:
1415103Sphk * 1. Redistributions of source code must retain the above copyright
1515103Sphk *    notice, this list of conditions and the following disclaimer.
1615103Sphk * 2. Redistributions in binary form must reproduce the above copyright
1715103Sphk *    notice, this list of conditions and the following disclaimer in the
1815103Sphk *    documentation and/or other materials provided with the distribution.
1915103Sphk * 4. Neither the name of the University nor the names of its contributors
2015103Sphk *    may be used to endorse or promote products derived from this software
2115103Sphk *    without specific prior written permission.
2215103Sphk *
2315103Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2415103Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2515103Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2615103Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2715103Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2815103Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2915103Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3015103Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3115103Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3215103Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3315103Sphk * SUCH DAMAGE.
3415103Sphk *
3515103Sphk *	@(#)kern_sysctl.c	8.4 (Berkeley) 4/14/94
3615103Sphk */
3715103Sphk
38116182Sobrien#include <sys/cdefs.h>
39116182Sobrien__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 170071 2007-05-28 20:41:10Z imp $");
40116182Sobrien
4186190Srwatson#include "opt_posix.h"
42169604Swkoszek#include "opt_config.h"
4384611Srwatson
4415103Sphk#include <sys/param.h>
4515103Sphk#include <sys/kernel.h>
46169507Swkoszek#include <sys/sbuf.h>
4715103Sphk#include <sys/systm.h>
4815103Sphk#include <sys/sysctl.h>
4915103Sphk#include <sys/proc.h>
5087275Srwatson#include <sys/lock.h>
5187275Srwatson#include <sys/mutex.h>
5246155Sphk#include <sys/jail.h>
5376078Sjhb#include <sys/smp.h>
54105046Smike#include <sys/unistd.h>
5528918Skato
5615103SphkSYSCTL_NODE(, 0,	  sysctl, CTLFLAG_RW, 0,
5715103Sphk	"Sysctl internal magic");
5815103SphkSYSCTL_NODE(, CTL_KERN,	  kern,   CTLFLAG_RW, 0,
5915103Sphk	"High kernel, proc, limits &c");
6015103SphkSYSCTL_NODE(, CTL_VM,	  vm,     CTLFLAG_RW, 0,
6115103Sphk	"Virtual memory");
6223382SbdeSYSCTL_NODE(, CTL_VFS,	  vfs,     CTLFLAG_RW, 0,
6315103Sphk	"File system");
6415103SphkSYSCTL_NODE(, CTL_NET,	  net,    CTLFLAG_RW, 0,
6515103Sphk	"Network, (see socket.h)");
6615103SphkSYSCTL_NODE(, CTL_DEBUG,  debug,  CTLFLAG_RW, 0,
6715103Sphk	"Debugging");
6848891SphkSYSCTL_NODE(_debug, OID_AUTO,  sizeof,  CTLFLAG_RW, 0,
6948891Sphk	"Sizeof various things");
7015103SphkSYSCTL_NODE(, CTL_HW,	  hw,     CTLFLAG_RW, 0,
7115103Sphk	"hardware");
7215103SphkSYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0,
7315103Sphk	"machine dependent");
7415103SphkSYSCTL_NODE(, CTL_USER,	  user,   CTLFLAG_RW, 0,
7515103Sphk	"user-level");
7634925SdufaultSYSCTL_NODE(, CTL_P1003_1B,  p1003_1b,   CTLFLAG_RW, 0,
7734925Sdufault	"p1003_1b, (see p1003_1b.h)");
7834029Sdufault
7950465SmarcelSYSCTL_NODE(, OID_AUTO,  compat, CTLFLAG_RW, 0,
8050465Smarcel	"Compatibility code");
8189414SarrSYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
8289414Sarr     	"Security");
8386190Srwatson#ifdef REGRESSION
8486190SrwatsonSYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
8586190Srwatson     "Regression test MIB");
8686190Srwatson#endif
8750465Smarcel
88116090SjmallettSYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD,
89116105Sjmallett    kern_ident, 0, "Kernel identifier");
90116090Sjmallett
9186189SrwatsonSYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
9288019Sluigi    osrelease, 0, "Operating system release");
9315103Sphk
9486189SrwatsonSYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
9546381Sbillf    0, BSD, "Operating system revision");
9615103Sphk
9786189SrwatsonSYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD,
9846381Sbillf    version, 0, "Kernel version");
9915103Sphk
10086189SrwatsonSYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD,
10146381Sbillf    ostype, 0, "Operating system type");
10215103Sphk
103119203Seivind/*
104119203Seivind * NOTICE: The *userland* release date is available in
105119203Seivind * /usr/include/osreldate.h
106119203Seivind */
10715103Sphkextern int osreldate;
10886189SrwatsonSYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD,
109119203Seivind    &osreldate, 0, "Kernel release date");
11015103Sphk
111121307SsilbySYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN,
11246381Sbillf    &maxproc, 0, "Maximum number of processes");
11315103Sphk
11486189SrwatsonSYSCTL_INT(_kern, KERN_MAXPROCPERUID, maxprocperuid, CTLFLAG_RW,
11546381Sbillf    &maxprocperuid, 0, "Maximum processes allowed per userid");
11615103Sphk
117121307SsilbySYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN,
11880418Speter    &maxusers, 0, "Hint for kernel tuning");
11980418Speter
12086189SrwatsonSYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD,
12146381Sbillf    0, ARG_MAX, "Maximum bytes of argument to execve(2)");
12215103Sphk
12386189SrwatsonSYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD,
124105046Smike    0, _POSIX_VERSION, "Version of POSIX attempting to comply to");
12515103Sphk
12686189SrwatsonSYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD,
12746381Sbillf    0, NGROUPS_MAX, "Maximum number of groups a user can belong to");
12815103Sphk
12986189SrwatsonSYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD,
13046381Sbillf    0, 1, "Whether job control is available");
13115103Sphk
13215103Sphk#ifdef _POSIX_SAVED_IDS
13386189SrwatsonSYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
13446381Sbillf    0, 1, "Whether saved set-group/user ID is available");
13515103Sphk#else
13686189SrwatsonSYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
13746381Sbillf    0, 0, "Whether saved set-group/user ID is available");
13815103Sphk#endif
13915103Sphk
14015103Sphkchar kernelname[MAXPATHLEN] = "/kernel";	/* XXX bloat */
14115103Sphk
14286189SrwatsonSYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
14346381Sbillf    kernelname, sizeof kernelname, "Name of kernel file booted");
14415103Sphk
14586189SrwatsonSYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD,
14646381Sbillf    &mp_ncpus, 0, "Number of active CPUs");
14715103Sphk
14886189SrwatsonSYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD,
14946381Sbillf    0, BYTE_ORDER, "System byte order");
15015103Sphk
15186189SrwatsonSYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD,
15246381Sbillf    0, PAGE_SIZE, "System memory page size");
15315103Sphk
154106605Stmmstatic int
155169727Skansysctl_kern_arnd(SYSCTL_HANDLER_ARGS)
156169727Skan{
157169727Skan	u_long val;
158169727Skan
159169727Skan	arc4rand(&val, sizeof(val), 0);
160169727Skan	return (sysctl_handle_long(oidp, &val, 0, req));
161169727Skan}
162169727Skan
163169727SkanSYSCTL_PROC(_kern, KERN_ARND, arandom, CTLFLAG_RD,
164169727Skan	0, 0, sysctl_kern_arnd, "L", "arc4rand");
165169727Skan
166169727Skanstatic int
167106605Stmmsysctl_hw_physmem(SYSCTL_HANDLER_ARGS)
168106605Stmm{
169106605Stmm	u_long val;
170106605Stmm
171106605Stmm	val = ctob(physmem);
172106605Stmm	return (sysctl_handle_long(oidp, &val, 0, req));
173106605Stmm}
174106605Stmm
175106605StmmSYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD,
176106605Stmm	0, 0, sysctl_hw_physmem, "LU", "");
177106605Stmm
178106605Stmmstatic int
179142834Swessysctl_hw_realmem(SYSCTL_HANDLER_ARGS)
180142834Swes{
181142834Swes	u_long val;
182142834Swes	val = ctob(realmem);
183142834Swes	return (sysctl_handle_long(oidp, &val, 0, req));
184142834Swes}
185142834SwesSYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD,
186142834Swes	0, 0, sysctl_hw_realmem, "LU", "");
187142834Swesstatic int
188106605Stmmsysctl_hw_usermem(SYSCTL_HANDLER_ARGS)
189106605Stmm{
190106605Stmm	u_long val;
191106605Stmm
192169667Sjeff	val = ctob(physmem - VMCNT_GET(wire_count));
193106605Stmm	return (sysctl_handle_long(oidp, &val, 0, req));
194106605Stmm}
195106605Stmm
196106605StmmSYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD,
197106605Stmm	0, 0, sysctl_hw_usermem, "LU", "");
198106605Stmm
199106605StmmSYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
200106605Stmm
20128885Skatostatic char	machine_arch[] = MACHINE_ARCH;
20228885SkatoSYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
20346381Sbillf    machine_arch, 0, "System architecture");
20428885Skato
20515103Sphkchar hostname[MAXHOSTNAMELEN];
20615103Sphk
20746155Sphkstatic int
20862573Sphksysctl_hostname(SYSCTL_HANDLER_ARGS)
20946155Sphk{
21087072Srwatson	struct prison *pr;
21187275Srwatson	char tmphostname[MAXHOSTNAMELEN];
21246155Sphk	int error;
21315103Sphk
21491406Sjhb	pr = req->td->td_ucred->cr_prison;
21587072Srwatson	if (pr != NULL) {
21657163Srwatson		if (!jail_set_hostname_allowed && req->newptr)
21786190Srwatson			return (EPERM);
21887275Srwatson		/*
21987275Srwatson		 * Process is in jail, so make a local copy of jail
22087275Srwatson		 * hostname to get/set so we don't have to hold the jail
22187275Srwatson		 * mutex during the sysctl copyin/copyout activities.
22287275Srwatson		 */
22387275Srwatson		mtx_lock(&pr->pr_mtx);
22487275Srwatson		bcopy(pr->pr_host, tmphostname, MAXHOSTNAMELEN);
22587275Srwatson		mtx_unlock(&pr->pr_mtx);
22687275Srwatson
22787275Srwatson		error = sysctl_handle_string(oidp, tmphostname,
22887072Srwatson		    sizeof pr->pr_host, req);
22987275Srwatson
23087275Srwatson		if (req->newptr != NULL && error == 0) {
23187275Srwatson			/*
23287275Srwatson			 * Copy the locally set hostname to the jail, if
23387275Srwatson			 * appropriate.
23487275Srwatson			 */
23587275Srwatson			mtx_lock(&pr->pr_mtx);
23687275Srwatson			bcopy(tmphostname, pr->pr_host, MAXHOSTNAMELEN);
23787275Srwatson			mtx_unlock(&pr->pr_mtx);
23887275Srwatson		}
23957111Srwatson	} else
24086189Srwatson		error = sysctl_handle_string(oidp,
24146155Sphk		    hostname, sizeof hostname, req);
24246155Sphk	return (error);
24346155Sphk}
24446155Sphk
24586189SrwatsonSYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
24646155Sphk       CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON,
24746381Sbillf       0, 0, sysctl_hostname, "A", "Hostname");
24846155Sphk
24986190Srwatsonstatic int	regression_securelevel_nonmonotonic = 0;
25084611Srwatson
25187072Srwatson#ifdef REGRESSION
25284611SrwatsonSYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
25384611Srwatson    &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
25486190Srwatson#endif
25584611Srwatson
25615103Sphkint securelevel = -1;
257114293Smarkmstatic struct mtx securelevel_mtx;
25815103Sphk
25993686SarrMTX_SYSINIT(securelevel_lock, &securelevel_mtx, "securelevel mutex lock",
26093686Sarr    MTX_DEF);
26193686Sarr
26215103Sphkstatic int
26362573Sphksysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
26415103Sphk{
26586145Srwatson	struct prison *pr;
26686140Srwatson	int error, level;
26715103Sphk
26891406Sjhb	pr = req->td->td_ucred->cr_prison;
26986145Srwatson
27086140Srwatson	/*
27186140Srwatson	 * If the process is in jail, return the maximum of the global and
272140676Srwatson	 * local levels; otherwise, return the global level.  Perform a
273141013Srwatson	 * lockless read since the securelevel is an integer.
27486140Srwatson	 */
275140676Srwatson	if (pr != NULL)
27686145Srwatson		level = imax(securelevel, pr->pr_securelevel);
277140676Srwatson	else
27886140Srwatson		level = securelevel;
27986140Srwatson	error = sysctl_handle_int(oidp, &level, 0, req);
28086140Srwatson	if (error || !req->newptr)
28186140Srwatson		return (error);
28286140Srwatson	/*
28386140Srwatson	 * Permit update only if the new securelevel exceeds the
28486140Srwatson	 * global level, and local level if any.
28586140Srwatson	 */
28686145Srwatson	if (pr != NULL) {
28787275Srwatson		mtx_lock(&pr->pr_mtx);
28887072Srwatson		if (!regression_securelevel_nonmonotonic &&
28987275Srwatson		    (level < imax(securelevel, pr->pr_securelevel))) {
29087275Srwatson			mtx_unlock(&pr->pr_mtx);
29186140Srwatson			return (EPERM);
29287275Srwatson		}
29386145Srwatson		pr->pr_securelevel = level;
29487275Srwatson		mtx_unlock(&pr->pr_mtx);
29586140Srwatson	} else {
29693686Sarr		mtx_lock(&securelevel_mtx);
29787072Srwatson		if (!regression_securelevel_nonmonotonic &&
29893686Sarr		    (level < securelevel)) {
29993686Sarr			mtx_unlock(&securelevel_mtx);
30086140Srwatson			return (EPERM);
30193686Sarr		}
30286140Srwatson		securelevel = level;
30393686Sarr		mtx_unlock(&securelevel_mtx);
30486140Srwatson	}
30586140Srwatson	return (error);
30615103Sphk}
30715103Sphk
30883990SrwatsonSYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
30983990Srwatson    CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
31083990Srwatson    "I", "Current secure level");
31161370Srwatson
312169604Swkoszek#ifdef INCLUDE_CONFIG_FILE
313169507Swkoszek/* Actual kernel configuration options. */
314169507Swkoszekextern char kernconfstring[];
315169507Swkoszek
316169507Swkoszekstatic int
317169507Swkoszeksysctl_kern_config(SYSCTL_HANDLER_ARGS)
318169507Swkoszek{
319170071Simp	return (sysctl_handle_string(oidp, kernconfstring,
320170071Simp	    strlen(kernconfstring), req));
321170071Simp}
322169507Swkoszek
323169507SwkoszekSYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW,
324169507Swkoszek    0, 0, sysctl_kern_config, "", "Kernel configuration file");
325169650Simp#endif
326169507Swkoszek
32715103Sphkchar domainname[MAXHOSTNAMELEN];
32817281SwollmanSYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
32946381Sbillf    &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
33015103Sphk
33186190Srwatsonu_long hostid;
33278609SpirzykSYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
333168545Spjdchar hostuuid[64] = "00000000-0000-0000-0000-000000000000";
334168545SpjdSYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid,
335168545Spjd    sizeof(hostuuid), "Host UUID");
33615103Sphk
33715103Sphk/*
33815103Sphk * This is really cheating.  These actually live in the libc, something
33986189Srwatson * which I'm not quite sure is a good idea anyway, but in order for
34015103Sphk * getnext and friends to actually work, we define dummies here.
34115103Sphk */
34286189SrwatsonSYSCTL_STRING(_user, USER_CS_PATH, cs_path, CTLFLAG_RD,
34346381Sbillf    "", 0, "PATH that finds all the standard utilities");
34486189SrwatsonSYSCTL_INT(_user, USER_BC_BASE_MAX, bc_base_max, CTLFLAG_RD,
34546381Sbillf    0, 0, "Max ibase/obase values in bc(1)");
34686189SrwatsonSYSCTL_INT(_user, USER_BC_DIM_MAX, bc_dim_max, CTLFLAG_RD,
34746381Sbillf    0, 0, "Max array size in bc(1)");
34886189SrwatsonSYSCTL_INT(_user, USER_BC_SCALE_MAX, bc_scale_max, CTLFLAG_RD,
34946381Sbillf    0, 0, "Max scale value in bc(1)");
35086189SrwatsonSYSCTL_INT(_user, USER_BC_STRING_MAX, bc_string_max, CTLFLAG_RD,
35146381Sbillf    0, 0, "Max string length in bc(1)");
35286189SrwatsonSYSCTL_INT(_user, USER_COLL_WEIGHTS_MAX, coll_weights_max, CTLFLAG_RD,
35346381Sbillf    0, 0, "Maximum number of weights assigned to an LC_COLLATE locale entry");
35418540SbdeSYSCTL_INT(_user, USER_EXPR_NEST_MAX, expr_nest_max, CTLFLAG_RD, 0, 0, "");
35586189SrwatsonSYSCTL_INT(_user, USER_LINE_MAX, line_max, CTLFLAG_RD,
35646381Sbillf    0, 0, "Max length (bytes) of a text-processing utility's input line");
35786189SrwatsonSYSCTL_INT(_user, USER_RE_DUP_MAX, re_dup_max, CTLFLAG_RD,
35846381Sbillf    0, 0, "Maximum number of repeats of a regexp permitted");
35986189SrwatsonSYSCTL_INT(_user, USER_POSIX2_VERSION, posix2_version, CTLFLAG_RD,
36086189Srwatson    0, 0,
36146381Sbillf    "The version of POSIX 1003.2 with which the system attempts to comply");
36286189SrwatsonSYSCTL_INT(_user, USER_POSIX2_C_BIND, posix2_c_bind, CTLFLAG_RD,
36346381Sbillf    0, 0, "Whether C development supports the C bindings option");
36486189SrwatsonSYSCTL_INT(_user, USER_POSIX2_C_DEV, posix2_c_dev, CTLFLAG_RD,
36546381Sbillf    0, 0, "Whether system supports the C development utilities option");
36686189SrwatsonSYSCTL_INT(_user, USER_POSIX2_CHAR_TERM, posix2_char_term, CTLFLAG_RD,
36746381Sbillf    0, 0, "");
36886189SrwatsonSYSCTL_INT(_user, USER_POSIX2_FORT_DEV, posix2_fort_dev, CTLFLAG_RD,
36946381Sbillf    0, 0, "Whether system supports FORTRAN development utilities");
37086189SrwatsonSYSCTL_INT(_user, USER_POSIX2_FORT_RUN, posix2_fort_run, CTLFLAG_RD,
37146381Sbillf    0, 0, "Whether system supports FORTRAN runtime utilities");
37286189SrwatsonSYSCTL_INT(_user, USER_POSIX2_LOCALEDEF, posix2_localedef, CTLFLAG_RD,
37346381Sbillf    0, 0, "Whether system supports creation of locales");
37486189SrwatsonSYSCTL_INT(_user, USER_POSIX2_SW_DEV, posix2_sw_dev, CTLFLAG_RD,
37546381Sbillf    0, 0, "Whether system supports software development utilities");
37686189SrwatsonSYSCTL_INT(_user, USER_POSIX2_UPE, posix2_upe, CTLFLAG_RD,
37746381Sbillf    0, 0, "Whether system supports the user portability utilities");
37886189SrwatsonSYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG_RD,
37946381Sbillf    0, 0, "Min Maximum number of streams a process may have open at one time");
38086189SrwatsonSYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
38146381Sbillf    0, 0, "Min Maximum number of types supported for timezone names");
38248891Sphk
38348891Sphk#include <sys/vnode.h>
38486189SrwatsonSYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
38548891Sphk    0, sizeof(struct vnode), "sizeof(struct vnode)");
38648891Sphk
38786189SrwatsonSYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD,
38848891Sphk    0, sizeof(struct proc), "sizeof(struct proc)");
38948927Sphk
39060041Sphk#include <sys/bio.h>
39158926Sphk#include <sys/buf.h>
39258926SphkSYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
39358926Sphk    0, sizeof(struct bio), "sizeof(struct bio)");
39458926SphkSYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
39558926Sphk    0, sizeof(struct buf), "sizeof(struct buf)");
39672376Sjake
39772376Sjake#include <sys/user.h>
39872376SjakeSYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
39972376Sjake    0, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
400108685Sjake
401108696Sjake/* XXX compatibility, remove for 6.0 */
402108696Sjake#include <sys/imgact.h>
403108696Sjake#include <sys/imgact_elf.h>
404108696SjakeSYSCTL_INT(_kern, OID_AUTO, fallback_elf_brand, CTLFLAG_RW,
405108696Sjake    &__elfN(fallback_brand), sizeof(__elfN(fallback_brand)),
406108696Sjake    "compatibility for kern.fallback_elf_brand");
407