kern_mib.c revision 169604
1139823Simp/*-
21541Srgrimes * Copyright (c) 1982, 1986, 1989, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed to Berkeley by
61541Srgrimes * Mike Karels at Berkeley Software Design, Inc.
71541Srgrimes *
81541Srgrimes * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
91541Srgrimes * project, to make these variables more userfriendly.
101541Srgrimes *
111541Srgrimes * Redistribution and use in source and binary forms, with or without
121541Srgrimes * modification, are permitted provided that the following conditions
131541Srgrimes * are met:
141541Srgrimes * 1. Redistributions of source code must retain the above copyright
151541Srgrimes *    notice, this list of conditions and the following disclaimer.
161541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
171541Srgrimes *    notice, this list of conditions and the following disclaimer in the
181541Srgrimes *    documentation and/or other materials provided with the distribution.
191541Srgrimes * 4. Neither the name of the University nor the names of its contributors
201541Srgrimes *    may be used to endorse or promote products derived from this software
211541Srgrimes *    without specific prior written permission.
221541Srgrimes *
231541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2985052Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3050477Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
332168Spaul * SUCH DAMAGE.
342168Spaul *
352168Spaul *	@(#)kern_sysctl.c	8.4 (Berkeley) 4/14/94
361541Srgrimes */
371541Srgrimes
388876Srgrimes#include <sys/cdefs.h>
391541Srgrimes__FBSDID("$FreeBSD: head/sys/kern/kern_mib.c 169604 2007-05-16 16:08:04Z wkoszek $");
401541Srgrimes
411541Srgrimes#include "opt_posix.h"
421541Srgrimes#include "opt_config.h"
431541Srgrimes
44191148Skmacy#include <sys/param.h>
45191148Skmacy#include <sys/kernel.h>
46191148Skmacy#include <sys/sbuf.h>
47191148Skmacy#include <sys/systm.h>
481541Srgrimes#include <sys/sysctl.h>
491541Srgrimes#include <sys/proc.h>
501541Srgrimes#include <sys/lock.h>
51191117Skmacy#include <sys/mutex.h>
521541Srgrimes#include <sys/jail.h>
531541Srgrimes#include <sys/smp.h>
541541Srgrimes#include <sys/unistd.h>
551541Srgrimes
561541SrgrimesSYSCTL_NODE(, 0,	  sysctl, CTLFLAG_RW, 0,
571541Srgrimes	"Sysctl internal magic");
581541SrgrimesSYSCTL_NODE(, CTL_KERN,	  kern,   CTLFLAG_RW, 0,
59122922Sandre	"High kernel, proc, limits &c");
60122922SandreSYSCTL_NODE(, CTL_VM,	  vm,     CTLFLAG_RW, 0,
61122922Sandre	"Virtual memory");
62122922SandreSYSCTL_NODE(, CTL_VFS,	  vfs,     CTLFLAG_RW, 0,
63191080Skmacy	"File system");
64122922SandreSYSCTL_NODE(, CTL_NET,	  net,    CTLFLAG_RW, 0,
65122922Sandre	"Network, (see socket.h)");
661541SrgrimesSYSCTL_NODE(, CTL_DEBUG,  debug,  CTLFLAG_RW, 0,
671541Srgrimes	"Debugging");
681541SrgrimesSYSCTL_NODE(_debug, OID_AUTO,  sizeof,  CTLFLAG_RW, 0,
691541Srgrimes	"Sizeof various things");
701541SrgrimesSYSCTL_NODE(, CTL_HW,	  hw,     CTLFLAG_RW, 0,
7113765Smpp	"hardware");
7213765SmppSYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0,
731541Srgrimes	"machine dependent");
741541SrgrimesSYSCTL_NODE(, CTL_USER,	  user,   CTLFLAG_RW, 0,
751541Srgrimes	"user-level");
761541SrgrimesSYSCTL_NODE(, CTL_P1003_1B,  p1003_1b,   CTLFLAG_RW, 0,
77191080Skmacy	"p1003_1b, (see p1003_1b.h)");
78191080Skmacy
791541SrgrimesSYSCTL_NODE(, OID_AUTO,  compat, CTLFLAG_RW, 0,
801541Srgrimes	"Compatibility code");
811541SrgrimesSYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
821541Srgrimes     	"Security");
831541Srgrimes#ifdef REGRESSION
841541SrgrimesSYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
851541Srgrimes     "Regression test MIB");
861541Srgrimes#endif
871541Srgrimes
881541SrgrimesSYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD,
89183200Szec    kern_ident, 0, "Kernel identifier");
90183200Szec
91183200SzecSYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
92183200Szec    osrelease, 0, "Operating system release");
93183200Szec
94183200SzecSYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
95183200Szec    0, BSD, "Operating system revision");
96183200Szec
97183200SzecSYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD,
98183200Szec    version, 0, "Kernel version");
99183200Szec
100183200SzecSYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD,
101183200Szec    ostype, 0, "Operating system type");
102183200Szec
103183200Szec/*
104183200Szec * NOTICE: The *userland* release date is available in
105183200Szec * /usr/include/osreldate.h
106183200Szec */
107183200Szecextern int osreldate;
108183200SzecSYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD,
109183200Szec    &osreldate, 0, "Kernel release date");
110178888Sjulian
111178888SjulianSYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN,
112178888Sjulian    &maxproc, 0, "Maximum number of processes");
1131541Srgrimes
1145833SbdeSYSCTL_INT(_kern, KERN_MAXPROCPERUID, maxprocperuid, CTLFLAG_RW,
1155833Sbde    &maxprocperuid, 0, "Maximum processes allowed per userid");
1165833Sbde
1175833SbdeSYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN,
1185833Sbde    &maxusers, 0, "Hint for kernel tuning");
1191541Srgrimes
1201541SrgrimesSYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD,
1211541Srgrimes    0, ARG_MAX, "Maximum bytes of argument to execve(2)");
1221541Srgrimes
1231541SrgrimesSYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD,
1241541Srgrimes    0, _POSIX_VERSION, "Version of POSIX attempting to comply to");
1251541Srgrimes
1261541SrgrimesSYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD,
1271541Srgrimes    0, NGROUPS_MAX, "Maximum number of groups a user can belong to");
128178167Sqingli
129178167SqingliSYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD,
1301541Srgrimes    0, 1, "Whether job control is available");
131178167Sqingli
1321541Srgrimes#ifdef _POSIX_SAVED_IDS
1331541SrgrimesSYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
134128454Sluigi    0, 1, "Whether saved set-group/user ID is available");
135128454Sluigi#else
136128454SluigiSYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
137128454Sluigi    0, 0, "Whether saved set-group/user ID is available");
138128454Sluigi#endif
139132780Skan
140132780Skanchar kernelname[MAXPATHLEN] = "/kernel";	/* XXX bloat */
1411541Srgrimes
142186119SqingliSYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
143186119Sqingli    kernelname, sizeof kernelname, "Name of kernel file booted");
1441541Srgrimes
145122922SandreSYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD,
146127828Sluigi    &mp_ncpus, 0, "Number of active CPUs");
147178888Sjulian
148120727SsamSYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD,
149120727Ssam    0, BYTE_ORDER, "System byte order");
150120727Ssam
151120727SsamSYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD,
1521541Srgrimes    0, PAGE_SIZE, "System memory page size");
1531541Srgrimes
1541541Srgrimesstatic int
1551541Srgrimessysctl_hw_physmem(SYSCTL_HANDLER_ARGS)
1561541Srgrimes{
1571541Srgrimes	u_long val;
1581541Srgrimes
1591541Srgrimes	val = ctob(physmem);
1601541Srgrimes	return (sysctl_handle_long(oidp, &val, 0, req));
1611541Srgrimes}
1621541Srgrimes
1631541SrgrimesSYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD,
1641541Srgrimes	0, 0, sysctl_hw_physmem, "LU", "");
1651541Srgrimes
1661541Srgrimesstatic int
1671541Srgrimessysctl_hw_realmem(SYSCTL_HANDLER_ARGS)
1684104Swollman{
1694104Swollman	u_long val;
1701541Srgrimes	val = ctob(realmem);
1711541Srgrimes	return (sysctl_handle_long(oidp, &val, 0, req));
1721541Srgrimes}
1731541SrgrimesSYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD,
1741541Srgrimes	0, 0, sysctl_hw_realmem, "LU", "");
1751541Srgrimesstatic int
1761541Srgrimessysctl_hw_usermem(SYSCTL_HANDLER_ARGS)
17786764Sjlemon{
178186119Sqingli	u_long val;
1791541Srgrimes
180187094Sqingli	val = ctob(physmem - cnt.v_wire_count);
181187094Sqingli	return (sysctl_handle_long(oidp, &val, 0, req));
182186500Sqingli}
1831541Srgrimes
1841541SrgrimesSYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD,
1851541Srgrimes	0, 0, sysctl_hw_usermem, "LU", "");
1861541Srgrimes
1871541SrgrimesSYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
188122921Sandre
189122921Sandrestatic char	machine_arch[] = MACHINE_ARCH;
190122921SandreSYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
191122921Sandre    machine_arch, 0, "System architecture");
192122921Sandre
193186119Sqinglichar hostname[MAXHOSTNAMELEN];
1945099Swollman
19518839Swollmanstatic int
1966245Swollmansysctl_hostname(SYSCTL_HANDLER_ARGS)
19715652Swollman{
19815652Swollman	struct prison *pr;
19915652Swollman	char tmphostname[MAXHOSTNAMELEN];
200191080Skmacy	int error;
201191080Skmacy
2021541Srgrimes	pr = req->td->td_ucred->cr_prison;
203191080Skmacy	if (pr != NULL) {
204191080Skmacy		if (!jail_set_hostname_allowed && req->newptr)
205156750Sandre			return (EPERM);
206156750Sandre		/*
207156750Sandre		 * Process is in jail, so make a local copy of jail
208191080Skmacy		 * hostname to get/set so we don't have to hold the jail
209156750Sandre		 * mutex during the sysctl copyin/copyout activities.
2101541Srgrimes		 */
2111541Srgrimes		mtx_lock(&pr->pr_mtx);
2121541Srgrimes		bcopy(pr->pr_host, tmphostname, MAXHOSTNAMELEN);
2131541Srgrimes		mtx_unlock(&pr->pr_mtx);
2141541Srgrimes
2151541Srgrimes		error = sysctl_handle_string(oidp, tmphostname,
2161541Srgrimes		    sizeof pr->pr_host, req);
2171541Srgrimes
2181541Srgrimes		if (req->newptr != NULL && error == 0) {
2191541Srgrimes			/*
2201541Srgrimes			 * Copy the locally set hostname to the jail, if
2211541Srgrimes			 * appropriate.
2221541Srgrimes			 */
2231541Srgrimes			mtx_lock(&pr->pr_mtx);
2241541Srgrimes			bcopy(tmphostname, pr->pr_host, MAXHOSTNAMELEN);
2251541Srgrimes			mtx_unlock(&pr->pr_mtx);
2261541Srgrimes		}
2271541Srgrimes	} else
2281541Srgrimes		error = sysctl_handle_string(oidp,
2291541Srgrimes		    hostname, sizeof hostname, req);
2301541Srgrimes	return (error);
2311541Srgrimes}
2321541Srgrimes
233156750SandreSYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
2341541Srgrimes       CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON,
2351541Srgrimes       0, 0, sysctl_hostname, "A", "Hostname");
2361541Srgrimes
2371541Srgrimesstatic int	regression_securelevel_nonmonotonic = 0;
238191124Skmacy
2391541Srgrimes#ifdef REGRESSION
24051252SruSYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
24151252Sru    &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
24251252Sru#endif
2431541Srgrimes
2441541Srgrimesint securelevel = -1;
2451541Srgrimesstatic struct mtx securelevel_mtx;
2461541Srgrimes
2471541SrgrimesMTX_SYSINIT(securelevel_lock, &securelevel_mtx, "securelevel mutex lock",
2481541Srgrimes    MTX_DEF);
2491541Srgrimes
2501541Srgrimesstatic int
2511541Srgrimessysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
2521541Srgrimes{
2531541Srgrimes	struct prison *pr;
2541541Srgrimes	int error, level;
2551541Srgrimes
2561541Srgrimes	pr = req->td->td_ucred->cr_prison;
25721666Swollman
25821666Swollman	/*
25989498Sru	 * If the process is in jail, return the maximum of the global and
260136155Ssam	 * local levels; otherwise, return the global level.  Perform a
2611541Srgrimes	 * lockless read since the securelevel is an integer.
26251252Sru	 */
26351252Sru	if (pr != NULL)
26451252Sru		level = imax(securelevel, pr->pr_securelevel);
2651541Srgrimes	else
2661541Srgrimes		level = securelevel;
26751252Sru	error = sysctl_handle_int(oidp, &level, 0, req);
2681541Srgrimes	if (error || !req->newptr)
2691541Srgrimes		return (error);
2701541Srgrimes	/*
2711541Srgrimes	 * Permit update only if the new securelevel exceeds the
2721541Srgrimes	 * global level, and local level if any.
273191080Skmacy	 */
2741541Srgrimes	if (pr != NULL) {
2751541Srgrimes		mtx_lock(&pr->pr_mtx);
27651252Sru		if (!regression_securelevel_nonmonotonic &&
2771541Srgrimes		    (level < imax(securelevel, pr->pr_securelevel))) {
2781541Srgrimes			mtx_unlock(&pr->pr_mtx);
2791541Srgrimes			return (EPERM);
2801541Srgrimes		}
2811541Srgrimes		pr->pr_securelevel = level;
2821541Srgrimes		mtx_unlock(&pr->pr_mtx);
2831541Srgrimes	} else {
2841541Srgrimes		mtx_lock(&securelevel_mtx);
2851541Srgrimes		if (!regression_securelevel_nonmonotonic &&
2861541Srgrimes		    (level < securelevel)) {
2871541Srgrimes			mtx_unlock(&securelevel_mtx);
2881541Srgrimes			return (EPERM);
2891541Srgrimes		}
2901541Srgrimes		securelevel = level;
2911541Srgrimes		mtx_unlock(&securelevel_mtx);
2921541Srgrimes	}
2931541Srgrimes	return (error);
2941541Srgrimes}
2951541Srgrimes
2961541SrgrimesSYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
2971541Srgrimes    CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
2981541Srgrimes    "I", "Current secure level");
2991541Srgrimes
3001541Srgrimes#ifdef INCLUDE_CONFIG_FILE
3011541Srgrimes/* Actual kernel configuration options. */
3021541Srgrimesextern char kernconfstring[];
30385074Sru#else
30485074Sruchar kernconfstring[] = "\0";
30585074Sru#endif
3061541Srgrimes
3071541Srgrimesstatic int
308128185Sluigisysctl_kern_config(SYSCTL_HANDLER_ARGS)
309128185Sluigi{
310128185Sluigi	struct sbuf *sb;
311128185Sluigi	int error;
312128185Sluigi	char *p;
313128185Sluigi
314128185Sluigi	sb = sbuf_new(NULL, NULL, 2048, SBUF_AUTOEXTEND);
315128185Sluigi	if (sb == NULL)
316128185Sluigi		return (ENOMEM);
317128185Sluigi	sbuf_clear(sb);
318128185Sluigi	p = kernconfstring;
319128185Sluigi	if (p == NULL || *p == '\0') {
32055205Speter		sbuf_printf(sb, "No kernel configuration\n");
321117752Shsu	} else {
322205024Sqingli		sbuf_printf(sb, "%s", p);
323205024Sqingli	}
324205024Sqingli	sbuf_trim(sb);
325204902Sqingli	sbuf_putc(sb, '\n');
326120727Ssam	sbuf_finish(sb);
327120727Ssam	error = sysctl_handle_string(oidp, sbuf_data(sb), sbuf_len(sb), req);
328120727Ssam	if (error)
329174934Smux		return (error);
330120727Ssam	sbuf_delete(sb);
331120727Ssam	return (error);
332120727Ssam}
333117752ShsuSYSCTL_PROC(_kern, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RW,
334122334Ssam    0, 0, sysctl_kern_config, "", "Kernel configuration file");
335122334Ssam
336122334Ssamchar domainname[MAXHOSTNAMELEN];
337186119SqingliSYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
338122334Ssam    &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
339150130Sandre
340182801Sjulianu_long hostid;
341122334SsamSYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
342122334Ssamchar hostuuid[64] = "00000000-0000-0000-0000-000000000000";
343122334SsamSYSCTL_STRING(_kern, KERN_HOSTUUID, hostuuid, CTLFLAG_RW, hostuuid,
344186119Sqingli    sizeof(hostuuid), "Host UUID");
345122334Ssam
346150130Sandre/*
347122334Ssam * This is really cheating.  These actually live in the libc, something
348122334Ssam * which I'm not quite sure is a good idea anyway, but in order for
349183017Sjulian * getnext and friends to actually work, we define dummies here.
350183017Sjulian */
351183017SjulianSYSCTL_STRING(_user, USER_CS_PATH, cs_path, CTLFLAG_RD,
352183017Sjulian    "", 0, "PATH that finds all the standard utilities");
353183017SjulianSYSCTL_INT(_user, USER_BC_BASE_MAX, bc_base_max, CTLFLAG_RD,
354183017Sjulian    0, 0, "Max ibase/obase values in bc(1)");
355183017SjulianSYSCTL_INT(_user, USER_BC_DIM_MAX, bc_dim_max, CTLFLAG_RD,
356183017Sjulian    0, 0, "Max array size in bc(1)");
357183017SjulianSYSCTL_INT(_user, USER_BC_SCALE_MAX, bc_scale_max, CTLFLAG_RD,
358182801Sjulian    0, 0, "Max scale value in bc(1)");
359122334SsamSYSCTL_INT(_user, USER_BC_STRING_MAX, bc_string_max, CTLFLAG_RD,
360183017Sjulian    0, 0, "Max string length in bc(1)");
361183017SjulianSYSCTL_INT(_user, USER_COLL_WEIGHTS_MAX, coll_weights_max, CTLFLAG_RD,
362183017Sjulian    0, 0, "Maximum number of weights assigned to an LC_COLLATE locale entry");
3631541SrgrimesSYSCTL_INT(_user, USER_EXPR_NEST_MAX, expr_nest_max, CTLFLAG_RD, 0, 0, "");
364183017SjulianSYSCTL_INT(_user, USER_LINE_MAX, line_max, CTLFLAG_RD,
365183017Sjulian    0, 0, "Max length (bytes) of a text-processing utility's input line");
366183017SjulianSYSCTL_INT(_user, USER_RE_DUP_MAX, re_dup_max, CTLFLAG_RD,
367183017Sjulian    0, 0, "Maximum number of repeats of a regexp permitted");
368183017SjulianSYSCTL_INT(_user, USER_POSIX2_VERSION, posix2_version, CTLFLAG_RD,
369183017Sjulian    0, 0,
370183017Sjulian    "The version of POSIX 1003.2 with which the system attempts to comply");
371183017SjulianSYSCTL_INT(_user, USER_POSIX2_C_BIND, posix2_c_bind, CTLFLAG_RD,
372183017Sjulian    0, 0, "Whether C development supports the C bindings option");
373183017SjulianSYSCTL_INT(_user, USER_POSIX2_C_DEV, posix2_c_dev, CTLFLAG_RD,
374183017Sjulian    0, 0, "Whether system supports the C development utilities option");
375183017SjulianSYSCTL_INT(_user, USER_POSIX2_CHAR_TERM, posix2_char_term, CTLFLAG_RD,
376183017Sjulian    0, 0, "");
377183017SjulianSYSCTL_INT(_user, USER_POSIX2_FORT_DEV, posix2_fort_dev, CTLFLAG_RD,
378183017Sjulian    0, 0, "Whether system supports FORTRAN development utilities");
379183017SjulianSYSCTL_INT(_user, USER_POSIX2_FORT_RUN, posix2_fort_run, CTLFLAG_RD,
380193232Sbz    0, 0, "Whether system supports FORTRAN runtime utilities");
3811541SrgrimesSYSCTL_INT(_user, USER_POSIX2_LOCALEDEF, posix2_localedef, CTLFLAG_RD,
38221666Swollman    0, 0, "Whether system supports creation of locales");
38321666SwollmanSYSCTL_INT(_user, USER_POSIX2_SW_DEV, posix2_sw_dev, CTLFLAG_RD,
384136155Ssam    0, 0, "Whether system supports software development utilities");
38592725SalfredSYSCTL_INT(_user, USER_POSIX2_UPE, posix2_upe, CTLFLAG_RD,
38692725Salfred    0, 0, "Whether system supports the user portability utilities");
38792725SalfredSYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG_RD,
38892725Salfred    0, 0, "Min Maximum number of streams a process may have open at one time");
38992725SalfredSYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
39092725Salfred    0, 0, "Min Maximum number of types supported for timezone names");
391201282Sqingli
392128621Sluigi#include <sys/vnode.h>
393128621SluigiSYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
394128621Sluigi    0, sizeof(struct vnode), "sizeof(struct vnode)");
395128621Sluigi
396128621SluigiSYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD,
397128621Sluigi    0, sizeof(struct proc), "sizeof(struct proc)");
398128621Sluigi
399128621Sluigi#include <sys/bio.h>
400128621Sluigi#include <sys/buf.h>
401128621SluigiSYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
402128621Sluigi    0, sizeof(struct bio), "sizeof(struct bio)");
403128621SluigiSYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
404128621Sluigi    0, sizeof(struct buf), "sizeof(struct buf)");
405178888Sjulian
406178888Sjulian#include <sys/user.h>
407183013SjulianSYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
408178888Sjulian    0, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
409178888Sjulian
410178888Sjulian/* XXX compatibility, remove for 6.0 */
411178888Sjulian#include <sys/imgact.h>
412128621Sluigi#include <sys/imgact_elf.h>
413128621SluigiSYSCTL_INT(_kern, OID_AUTO, fallback_elf_brand, CTLFLAG_RW,
414120727Ssam    &__elfN(fallback_brand), sizeof(__elfN(fallback_brand)),
41592725Salfred    "compatibility for kern.fallback_elf_brand");
41692725Salfred