kern_mib.c revision 176367
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 176367 2008-02-17 16:44:48Z antoine $");
40116182Sobrien
41175417Sjhb#include "opt_compat.h"
4286190Srwatson#include "opt_posix.h"
43169604Swkoszek#include "opt_config.h"
4484611Srwatson
4515103Sphk#include <sys/param.h>
4615103Sphk#include <sys/kernel.h>
47169507Swkoszek#include <sys/sbuf.h>
4815103Sphk#include <sys/systm.h>
4915103Sphk#include <sys/sysctl.h>
5015103Sphk#include <sys/proc.h>
5187275Srwatson#include <sys/lock.h>
5287275Srwatson#include <sys/mutex.h>
5346155Sphk#include <sys/jail.h>
5476078Sjhb#include <sys/smp.h>
55105046Smike#include <sys/unistd.h>
5628918Skato
5715103SphkSYSCTL_NODE(, 0,	  sysctl, CTLFLAG_RW, 0,
5815103Sphk	"Sysctl internal magic");
5915103SphkSYSCTL_NODE(, CTL_KERN,	  kern,   CTLFLAG_RW, 0,
6015103Sphk	"High kernel, proc, limits &c");
6115103SphkSYSCTL_NODE(, CTL_VM,	  vm,     CTLFLAG_RW, 0,
6215103Sphk	"Virtual memory");
6323382SbdeSYSCTL_NODE(, CTL_VFS,	  vfs,     CTLFLAG_RW, 0,
6415103Sphk	"File system");
6515103SphkSYSCTL_NODE(, CTL_NET,	  net,    CTLFLAG_RW, 0,
6615103Sphk	"Network, (see socket.h)");
6715103SphkSYSCTL_NODE(, CTL_DEBUG,  debug,  CTLFLAG_RW, 0,
6815103Sphk	"Debugging");
6948891SphkSYSCTL_NODE(_debug, OID_AUTO,  sizeof,  CTLFLAG_RW, 0,
7048891Sphk	"Sizeof various things");
7115103SphkSYSCTL_NODE(, CTL_HW,	  hw,     CTLFLAG_RW, 0,
7215103Sphk	"hardware");
7315103SphkSYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0,
7415103Sphk	"machine dependent");
7515103SphkSYSCTL_NODE(, CTL_USER,	  user,   CTLFLAG_RW, 0,
7615103Sphk	"user-level");
7734925SdufaultSYSCTL_NODE(, CTL_P1003_1B,  p1003_1b,   CTLFLAG_RW, 0,
7834925Sdufault	"p1003_1b, (see p1003_1b.h)");
7934029Sdufault
8050465SmarcelSYSCTL_NODE(, OID_AUTO,  compat, CTLFLAG_RW, 0,
8150465Smarcel	"Compatibility code");
8289414SarrSYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
8389414Sarr     	"Security");
8486190Srwatson#ifdef REGRESSION
8586190SrwatsonSYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
8686190Srwatson     "Regression test MIB");
8786190Srwatson#endif
8850465Smarcel
89116090SjmallettSYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD,
90116105Sjmallett    kern_ident, 0, "Kernel identifier");
91116090Sjmallett
9286189SrwatsonSYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
9388019Sluigi    osrelease, 0, "Operating system release");
9415103Sphk
9586189SrwatsonSYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
9646381Sbillf    0, BSD, "Operating system revision");
9715103Sphk
9886189SrwatsonSYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD,
9946381Sbillf    version, 0, "Kernel version");
10015103Sphk
10186189SrwatsonSYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD,
10246381Sbillf    ostype, 0, "Operating system type");
10315103Sphk
104119203Seivind/*
105119203Seivind * NOTICE: The *userland* release date is available in
106119203Seivind * /usr/include/osreldate.h
107119203Seivind */
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{
157176367Santoine	char buf[256];
158176367Santoine	size_t len;
159169727Skan
160176367Santoine	len = req->oldlen;
161176367Santoine	if (len > sizeof(buf))
162176367Santoine		len = sizeof(buf);
163176367Santoine	arc4rand(buf, len, 0);
164176367Santoine	return (SYSCTL_OUT(req, buf, len));
165169727Skan}
166169727Skan
167176367SantoineSYSCTL_PROC(_kern, KERN_ARND, arandom, CTLTYPE_OPAQUE | CTLFLAG_RD,
168176367Santoine    NULL, 0, sysctl_kern_arnd, "", "arc4rand");
169169727Skan
170169727Skanstatic int
171106605Stmmsysctl_hw_physmem(SYSCTL_HANDLER_ARGS)
172106605Stmm{
173106605Stmm	u_long val;
174106605Stmm
175106605Stmm	val = ctob(physmem);
176106605Stmm	return (sysctl_handle_long(oidp, &val, 0, req));
177106605Stmm}
178106605Stmm
179106605StmmSYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD,
180106605Stmm	0, 0, sysctl_hw_physmem, "LU", "");
181106605Stmm
182106605Stmmstatic int
183142834Swessysctl_hw_realmem(SYSCTL_HANDLER_ARGS)
184142834Swes{
185142834Swes	u_long val;
186142834Swes	val = ctob(realmem);
187142834Swes	return (sysctl_handle_long(oidp, &val, 0, req));
188142834Swes}
189142834SwesSYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD,
190142834Swes	0, 0, sysctl_hw_realmem, "LU", "");
191142834Swesstatic int
192106605Stmmsysctl_hw_usermem(SYSCTL_HANDLER_ARGS)
193106605Stmm{
194106605Stmm	u_long val;
195106605Stmm
196170170Sattilio	val = ctob(physmem - cnt.v_wire_count);
197106605Stmm	return (sysctl_handle_long(oidp, &val, 0, req));
198106605Stmm}
199106605Stmm
200106605StmmSYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD,
201106605Stmm	0, 0, sysctl_hw_usermem, "LU", "");
202106605Stmm
203106605StmmSYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
204106605Stmm
20528885Skatostatic char	machine_arch[] = MACHINE_ARCH;
20628885SkatoSYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
20746381Sbillf    machine_arch, 0, "System architecture");
20828885Skato
20915103Sphkchar hostname[MAXHOSTNAMELEN];
21015103Sphk
21146155Sphkstatic int
21262573Sphksysctl_hostname(SYSCTL_HANDLER_ARGS)
21346155Sphk{
21487072Srwatson	struct prison *pr;
21587275Srwatson	char tmphostname[MAXHOSTNAMELEN];
21646155Sphk	int error;
21715103Sphk
21891406Sjhb	pr = req->td->td_ucred->cr_prison;
21987072Srwatson	if (pr != NULL) {
22057163Srwatson		if (!jail_set_hostname_allowed && req->newptr)
22186190Srwatson			return (EPERM);
22287275Srwatson		/*
22387275Srwatson		 * Process is in jail, so make a local copy of jail
22487275Srwatson		 * hostname to get/set so we don't have to hold the jail
22587275Srwatson		 * mutex during the sysctl copyin/copyout activities.
22687275Srwatson		 */
22787275Srwatson		mtx_lock(&pr->pr_mtx);
22887275Srwatson		bcopy(pr->pr_host, tmphostname, MAXHOSTNAMELEN);
22987275Srwatson		mtx_unlock(&pr->pr_mtx);
23087275Srwatson
23187275Srwatson		error = sysctl_handle_string(oidp, tmphostname,
23287072Srwatson		    sizeof pr->pr_host, req);
23387275Srwatson
23487275Srwatson		if (req->newptr != NULL && error == 0) {
23587275Srwatson			/*
23687275Srwatson			 * Copy the locally set hostname to the jail, if
23787275Srwatson			 * appropriate.
23887275Srwatson			 */
23987275Srwatson			mtx_lock(&pr->pr_mtx);
24087275Srwatson			bcopy(tmphostname, pr->pr_host, MAXHOSTNAMELEN);
24187275Srwatson			mtx_unlock(&pr->pr_mtx);
24287275Srwatson		}
24357111Srwatson	} else
24486189Srwatson		error = sysctl_handle_string(oidp,
24546155Sphk		    hostname, sizeof hostname, req);
24646155Sphk	return (error);
24746155Sphk}
24846155Sphk
24986189SrwatsonSYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
25046155Sphk       CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON,
25146381Sbillf       0, 0, sysctl_hostname, "A", "Hostname");
25246155Sphk
25386190Srwatsonstatic int	regression_securelevel_nonmonotonic = 0;
25484611Srwatson
25587072Srwatson#ifdef REGRESSION
25684611SrwatsonSYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
25784611Srwatson    &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
25886190Srwatson#endif
25984611Srwatson
26015103Sphkint securelevel = -1;
261114293Smarkmstatic struct mtx securelevel_mtx;
26215103Sphk
26393686SarrMTX_SYSINIT(securelevel_lock, &securelevel_mtx, "securelevel mutex lock",
26493686Sarr    MTX_DEF);
26593686Sarr
26615103Sphkstatic int
26762573Sphksysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
26815103Sphk{
26986145Srwatson	struct prison *pr;
27086140Srwatson	int error, level;
27115103Sphk
27291406Sjhb	pr = req->td->td_ucred->cr_prison;
27386145Srwatson
27486140Srwatson	/*
27586140Srwatson	 * If the process is in jail, return the maximum of the global and
276140676Srwatson	 * local levels; otherwise, return the global level.  Perform a
277141013Srwatson	 * lockless read since the securelevel is an integer.
27886140Srwatson	 */
279140676Srwatson	if (pr != NULL)
28086145Srwatson		level = imax(securelevel, pr->pr_securelevel);
281140676Srwatson	else
28286140Srwatson		level = securelevel;
28386140Srwatson	error = sysctl_handle_int(oidp, &level, 0, req);
28486140Srwatson	if (error || !req->newptr)
28586140Srwatson		return (error);
28686140Srwatson	/*
28786140Srwatson	 * Permit update only if the new securelevel exceeds the
28886140Srwatson	 * global level, and local level if any.
28986140Srwatson	 */
29086145Srwatson	if (pr != NULL) {
29187275Srwatson		mtx_lock(&pr->pr_mtx);
29287072Srwatson		if (!regression_securelevel_nonmonotonic &&
29387275Srwatson		    (level < imax(securelevel, pr->pr_securelevel))) {
29487275Srwatson			mtx_unlock(&pr->pr_mtx);
29586140Srwatson			return (EPERM);
29687275Srwatson		}
29786145Srwatson		pr->pr_securelevel = level;
29887275Srwatson		mtx_unlock(&pr->pr_mtx);
29986140Srwatson	} else {
30093686Sarr		mtx_lock(&securelevel_mtx);
30187072Srwatson		if (!regression_securelevel_nonmonotonic &&
30293686Sarr		    (level < securelevel)) {
30393686Sarr			mtx_unlock(&securelevel_mtx);
30486140Srwatson			return (EPERM);
30593686Sarr		}
30686140Srwatson		securelevel = level;
30793686Sarr		mtx_unlock(&securelevel_mtx);
30886140Srwatson	}
30986140Srwatson	return (error);
31015103Sphk}
31115103Sphk
31283990SrwatsonSYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
31383990Srwatson    CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
31483990Srwatson    "I", "Current secure level");
31561370Srwatson
316169604Swkoszek#ifdef INCLUDE_CONFIG_FILE
317169507Swkoszek/* Actual kernel configuration options. */
318169507Swkoszekextern char kernconfstring[];
319169507Swkoszek
320169507Swkoszekstatic int
321169507Swkoszeksysctl_kern_config(SYSCTL_HANDLER_ARGS)
322169507Swkoszek{
323170071Simp	return (sysctl_handle_string(oidp, kernconfstring,
324170071Simp	    strlen(kernconfstring), req));
325170071Simp}
326169507Swkoszek
327169507SwkoszekSYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW,
328169507Swkoszek    0, 0, sysctl_kern_config, "", "Kernel configuration file");
329169650Simp#endif
330169507Swkoszek
33115103Sphkchar domainname[MAXHOSTNAMELEN];
33217281SwollmanSYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
33346381Sbillf    &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
33415103Sphk
33586190Srwatsonu_long hostid;
33678609SpirzykSYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
337168545Spjdchar hostuuid[64] = "00000000-0000-0000-0000-000000000000";
338168545SpjdSYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid,
339168545Spjd    sizeof(hostuuid), "Host UUID");
34015103Sphk
341175021SjhbSYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD, 0, "Kernel Features");
342175021Sjhb
343175417Sjhb#ifdef COMPAT_FREEBSD4
344175417SjhbFEATURE(compat_freebsd4, "Compatible with FreeBSD 4");
345175417Sjhb#endif
346175417Sjhb
347175417Sjhb#ifdef COMPAT_FREEBSD5
348175417SjhbFEATURE(compat_freebsd5, "Compatible with FreeBSD 5");
349175417Sjhb#endif
350175417Sjhb
351175417Sjhb#ifdef COMPAT_FREEBSD6
352175417SjhbFEATURE(compat_freebsd6, "Compatible with FreeBSD 6");
353175417Sjhb#endif
354175417Sjhb
355175417Sjhb#ifdef COMPAT_FREEBSD7
356175417SjhbFEATURE(compat_freebsd7, "Compatible with FreeBSD 7");
357175417Sjhb#endif
358175417Sjhb
35915103Sphk/*
36015103Sphk * This is really cheating.  These actually live in the libc, something
36186189Srwatson * which I'm not quite sure is a good idea anyway, but in order for
36215103Sphk * getnext and friends to actually work, we define dummies here.
36315103Sphk */
36486189SrwatsonSYSCTL_STRING(_user, USER_CS_PATH, cs_path, CTLFLAG_RD,
36546381Sbillf    "", 0, "PATH that finds all the standard utilities");
36686189SrwatsonSYSCTL_INT(_user, USER_BC_BASE_MAX, bc_base_max, CTLFLAG_RD,
36746381Sbillf    0, 0, "Max ibase/obase values in bc(1)");
36886189SrwatsonSYSCTL_INT(_user, USER_BC_DIM_MAX, bc_dim_max, CTLFLAG_RD,
36946381Sbillf    0, 0, "Max array size in bc(1)");
37086189SrwatsonSYSCTL_INT(_user, USER_BC_SCALE_MAX, bc_scale_max, CTLFLAG_RD,
37146381Sbillf    0, 0, "Max scale value in bc(1)");
37286189SrwatsonSYSCTL_INT(_user, USER_BC_STRING_MAX, bc_string_max, CTLFLAG_RD,
37346381Sbillf    0, 0, "Max string length in bc(1)");
37486189SrwatsonSYSCTL_INT(_user, USER_COLL_WEIGHTS_MAX, coll_weights_max, CTLFLAG_RD,
37546381Sbillf    0, 0, "Maximum number of weights assigned to an LC_COLLATE locale entry");
37618540SbdeSYSCTL_INT(_user, USER_EXPR_NEST_MAX, expr_nest_max, CTLFLAG_RD, 0, 0, "");
37786189SrwatsonSYSCTL_INT(_user, USER_LINE_MAX, line_max, CTLFLAG_RD,
37846381Sbillf    0, 0, "Max length (bytes) of a text-processing utility's input line");
37986189SrwatsonSYSCTL_INT(_user, USER_RE_DUP_MAX, re_dup_max, CTLFLAG_RD,
38046381Sbillf    0, 0, "Maximum number of repeats of a regexp permitted");
38186189SrwatsonSYSCTL_INT(_user, USER_POSIX2_VERSION, posix2_version, CTLFLAG_RD,
38286189Srwatson    0, 0,
38346381Sbillf    "The version of POSIX 1003.2 with which the system attempts to comply");
38486189SrwatsonSYSCTL_INT(_user, USER_POSIX2_C_BIND, posix2_c_bind, CTLFLAG_RD,
38546381Sbillf    0, 0, "Whether C development supports the C bindings option");
38686189SrwatsonSYSCTL_INT(_user, USER_POSIX2_C_DEV, posix2_c_dev, CTLFLAG_RD,
38746381Sbillf    0, 0, "Whether system supports the C development utilities option");
38886189SrwatsonSYSCTL_INT(_user, USER_POSIX2_CHAR_TERM, posix2_char_term, CTLFLAG_RD,
38946381Sbillf    0, 0, "");
39086189SrwatsonSYSCTL_INT(_user, USER_POSIX2_FORT_DEV, posix2_fort_dev, CTLFLAG_RD,
39146381Sbillf    0, 0, "Whether system supports FORTRAN development utilities");
39286189SrwatsonSYSCTL_INT(_user, USER_POSIX2_FORT_RUN, posix2_fort_run, CTLFLAG_RD,
39346381Sbillf    0, 0, "Whether system supports FORTRAN runtime utilities");
39486189SrwatsonSYSCTL_INT(_user, USER_POSIX2_LOCALEDEF, posix2_localedef, CTLFLAG_RD,
39546381Sbillf    0, 0, "Whether system supports creation of locales");
39686189SrwatsonSYSCTL_INT(_user, USER_POSIX2_SW_DEV, posix2_sw_dev, CTLFLAG_RD,
39746381Sbillf    0, 0, "Whether system supports software development utilities");
39886189SrwatsonSYSCTL_INT(_user, USER_POSIX2_UPE, posix2_upe, CTLFLAG_RD,
39946381Sbillf    0, 0, "Whether system supports the user portability utilities");
40086189SrwatsonSYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG_RD,
40146381Sbillf    0, 0, "Min Maximum number of streams a process may have open at one time");
40286189SrwatsonSYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
40346381Sbillf    0, 0, "Min Maximum number of types supported for timezone names");
40448891Sphk
40548891Sphk#include <sys/vnode.h>
40686189SrwatsonSYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
40748891Sphk    0, sizeof(struct vnode), "sizeof(struct vnode)");
40848891Sphk
40986189SrwatsonSYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD,
41048891Sphk    0, sizeof(struct proc), "sizeof(struct proc)");
41148927Sphk
41260041Sphk#include <sys/bio.h>
41358926Sphk#include <sys/buf.h>
41458926SphkSYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
41558926Sphk    0, sizeof(struct bio), "sizeof(struct bio)");
41658926SphkSYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
41758926Sphk    0, sizeof(struct buf), "sizeof(struct buf)");
41872376Sjake
41972376Sjake#include <sys/user.h>
42072376SjakeSYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
42172376Sjake    0, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
422108685Sjake
423108696Sjake/* XXX compatibility, remove for 6.0 */
424108696Sjake#include <sys/imgact.h>
425108696Sjake#include <sys/imgact_elf.h>
426108696SjakeSYSCTL_INT(_kern, OID_AUTO, fallback_elf_brand, CTLFLAG_RW,
427108696Sjake    &__elfN(fallback_brand), sizeof(__elfN(fallback_brand)),
428108696Sjake    "compatibility for kern.fallback_elf_brand");
429