xref: /freebsd/sys/kern/kern_mib.c (revision 9afc1eee4f4f5044ed1fb28b93d73c9c22de6523)
145ec3b38SPoul-Henning Kamp /*-
245ec3b38SPoul-Henning Kamp  * Copyright (c) 1982, 1986, 1989, 1993
345ec3b38SPoul-Henning Kamp  *	The Regents of the University of California.  All rights reserved.
445ec3b38SPoul-Henning Kamp  *
545ec3b38SPoul-Henning Kamp  * This code is derived from software contributed to Berkeley by
645ec3b38SPoul-Henning Kamp  * Mike Karels at Berkeley Software Design, Inc.
745ec3b38SPoul-Henning Kamp  *
845ec3b38SPoul-Henning Kamp  * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
945ec3b38SPoul-Henning Kamp  * project, to make these variables more userfriendly.
1045ec3b38SPoul-Henning Kamp  *
1145ec3b38SPoul-Henning Kamp  * Redistribution and use in source and binary forms, with or without
1245ec3b38SPoul-Henning Kamp  * modification, are permitted provided that the following conditions
1345ec3b38SPoul-Henning Kamp  * are met:
1445ec3b38SPoul-Henning Kamp  * 1. Redistributions of source code must retain the above copyright
1545ec3b38SPoul-Henning Kamp  *    notice, this list of conditions and the following disclaimer.
1645ec3b38SPoul-Henning Kamp  * 2. Redistributions in binary form must reproduce the above copyright
1745ec3b38SPoul-Henning Kamp  *    notice, this list of conditions and the following disclaimer in the
1845ec3b38SPoul-Henning Kamp  *    documentation and/or other materials provided with the distribution.
1945ec3b38SPoul-Henning Kamp  * 3. All advertising materials mentioning features or use of this software
2045ec3b38SPoul-Henning Kamp  *    must display the following acknowledgement:
2145ec3b38SPoul-Henning Kamp  *	This product includes software developed by the University of
2245ec3b38SPoul-Henning Kamp  *	California, Berkeley and its contributors.
2345ec3b38SPoul-Henning Kamp  * 4. Neither the name of the University nor the names of its contributors
2445ec3b38SPoul-Henning Kamp  *    may be used to endorse or promote products derived from this software
2545ec3b38SPoul-Henning Kamp  *    without specific prior written permission.
2645ec3b38SPoul-Henning Kamp  *
2745ec3b38SPoul-Henning Kamp  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2845ec3b38SPoul-Henning Kamp  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2945ec3b38SPoul-Henning Kamp  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3045ec3b38SPoul-Henning Kamp  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3145ec3b38SPoul-Henning Kamp  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3245ec3b38SPoul-Henning Kamp  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3345ec3b38SPoul-Henning Kamp  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3445ec3b38SPoul-Henning Kamp  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3545ec3b38SPoul-Henning Kamp  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3645ec3b38SPoul-Henning Kamp  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3745ec3b38SPoul-Henning Kamp  * SUCH DAMAGE.
3845ec3b38SPoul-Henning Kamp  *
3945ec3b38SPoul-Henning Kamp  *	@(#)kern_sysctl.c	8.4 (Berkeley) 4/14/94
40c3aac50fSPeter Wemm  * $FreeBSD$
4145ec3b38SPoul-Henning Kamp  */
4245ec3b38SPoul-Henning Kamp 
43c175d222SRobert Watson #include "opt_global.h"
44c175d222SRobert Watson 
4545ec3b38SPoul-Henning Kamp #include <sys/param.h>
4645ec3b38SPoul-Henning Kamp #include <sys/kernel.h>
4745ec3b38SPoul-Henning Kamp #include <sys/systm.h>
4845ec3b38SPoul-Henning Kamp #include <sys/sysctl.h>
4945ec3b38SPoul-Henning Kamp #include <sys/proc.h>
5075c13541SPoul-Henning Kamp #include <sys/jail.h>
516caa8a15SJohn Baldwin #include <sys/smp.h>
52662f9a69SKATO Takenori 
5345ec3b38SPoul-Henning Kamp SYSCTL_NODE(, 0,	  sysctl, CTLFLAG_RW, 0,
5445ec3b38SPoul-Henning Kamp 	"Sysctl internal magic");
5545ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_KERN,	  kern,   CTLFLAG_RW, 0,
5645ec3b38SPoul-Henning Kamp 	"High kernel, proc, limits &c");
5745ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_VM,	  vm,     CTLFLAG_RW, 0,
5845ec3b38SPoul-Henning Kamp 	"Virtual memory");
594a8b9660SBruce Evans SYSCTL_NODE(, CTL_VFS,	  vfs,     CTLFLAG_RW, 0,
6045ec3b38SPoul-Henning Kamp 	"File system");
6145ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_NET,	  net,    CTLFLAG_RW, 0,
6245ec3b38SPoul-Henning Kamp 	"Network, (see socket.h)");
6345ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_DEBUG,  debug,  CTLFLAG_RW, 0,
6445ec3b38SPoul-Henning Kamp 	"Debugging");
656f13bfc2SPoul-Henning Kamp SYSCTL_NODE(_debug, OID_AUTO,  sizeof,  CTLFLAG_RW, 0,
666f13bfc2SPoul-Henning Kamp 	"Sizeof various things");
6745ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_HW,	  hw,     CTLFLAG_RW, 0,
6845ec3b38SPoul-Henning Kamp 	"hardware");
6945ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_MACHDEP, machdep, CTLFLAG_RW, 0,
7045ec3b38SPoul-Henning Kamp 	"machine dependent");
7145ec3b38SPoul-Henning Kamp SYSCTL_NODE(, CTL_USER,	  user,   CTLFLAG_RW, 0,
7245ec3b38SPoul-Henning Kamp 	"user-level");
738a6472b7SPeter Dufault SYSCTL_NODE(, CTL_P1003_1B,  p1003_1b,   CTLFLAG_RW, 0,
748a6472b7SPeter Dufault 	"p1003_1b, (see p1003_1b.h)");
75644d85f4SPeter Dufault 
76c6dfea0eSMarcel Moolenaar SYSCTL_NODE(, OID_AUTO,  compat, CTLFLAG_RW, 0,
77c6dfea0eSMarcel Moolenaar 	"Compatibility code");
78c6dfea0eSMarcel Moolenaar 
793d177f46SBill Fumerola SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD,
803d177f46SBill Fumerola     osrelease, 0, "Operating system type");
8145ec3b38SPoul-Henning Kamp 
823d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD,
833d177f46SBill Fumerola     0, BSD, "Operating system revision");
8445ec3b38SPoul-Henning Kamp 
853d177f46SBill Fumerola SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD,
863d177f46SBill Fumerola     version, 0, "Kernel version");
8745ec3b38SPoul-Henning Kamp 
883d177f46SBill Fumerola SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD,
893d177f46SBill Fumerola     ostype, 0, "Operating system type");
9045ec3b38SPoul-Henning Kamp 
9145ec3b38SPoul-Henning Kamp extern int osreldate;
923d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD,
933d177f46SBill Fumerola     &osreldate, 0, "Operating system release date");
9445ec3b38SPoul-Henning Kamp 
953d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RD,
963d177f46SBill Fumerola     &maxproc, 0, "Maximum number of processes");
9745ec3b38SPoul-Henning Kamp 
983d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_MAXPROCPERUID, maxprocperuid, CTLFLAG_RW,
993d177f46SBill Fumerola     &maxprocperuid, 0, "Maximum processes allowed per userid");
10045ec3b38SPoul-Henning Kamp 
10124a590a0SPeter Wemm SYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RD,
102ee342e1bSPeter Wemm     &maxusers, 0, "Hint for kernel tuning");
103ee342e1bSPeter Wemm 
1043d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD,
1053d177f46SBill Fumerola     0, ARG_MAX, "Maximum bytes of argument to execve(2)");
10645ec3b38SPoul-Henning Kamp 
1073d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD,
1083d177f46SBill Fumerola     0, _KPOSIX_VERSION, "Version of POSIX attempting to comply to");
10945ec3b38SPoul-Henning Kamp 
1103d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD,
1113d177f46SBill Fumerola     0, NGROUPS_MAX, "Maximum number of groups a user can belong to");
11245ec3b38SPoul-Henning Kamp 
1133d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD,
1143d177f46SBill Fumerola     0, 1, "Whether job control is available");
11545ec3b38SPoul-Henning Kamp 
11645ec3b38SPoul-Henning Kamp #ifdef _POSIX_SAVED_IDS
1173d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
1183d177f46SBill Fumerola     0, 1, "Whether saved set-group/user ID is available");
11945ec3b38SPoul-Henning Kamp #else
1203d177f46SBill Fumerola SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD,
1213d177f46SBill Fumerola     0, 0, "Whether saved set-group/user ID is available");
12245ec3b38SPoul-Henning Kamp #endif
12345ec3b38SPoul-Henning Kamp 
12445ec3b38SPoul-Henning Kamp char kernelname[MAXPATHLEN] = "/kernel";	/* XXX bloat */
12545ec3b38SPoul-Henning Kamp 
1263d177f46SBill Fumerola SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
1273d177f46SBill Fumerola     kernelname, sizeof kernelname, "Name of kernel file booted");
12845ec3b38SPoul-Henning Kamp 
129b3b84d9bSGary Palmer #ifdef SMP
1303d177f46SBill Fumerola SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD,
1313d177f46SBill Fumerola     &mp_ncpus, 0, "Number of active CPUs");
132b3b84d9bSGary Palmer #else
1333d177f46SBill Fumerola SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD,
1343d177f46SBill Fumerola     0, 1, "Number of active CPUs");
135b3b84d9bSGary Palmer #endif
13645ec3b38SPoul-Henning Kamp 
1373d177f46SBill Fumerola SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD,
1383d177f46SBill Fumerola     0, BYTE_ORDER, "System byte order");
13945ec3b38SPoul-Henning Kamp 
1403d177f46SBill Fumerola SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD,
1413d177f46SBill Fumerola     0, PAGE_SIZE, "System memory page size");
14245ec3b38SPoul-Henning Kamp 
143664f8517SKATO Takenori static char	machine_arch[] = MACHINE_ARCH;
144664f8517SKATO Takenori SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
1453d177f46SBill Fumerola     machine_arch, 0, "System architecture");
146664f8517SKATO Takenori 
147c175d222SRobert Watson #ifdef REGRESSION
148c175d222SRobert Watson SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0, "Regression test MIB");
149c175d222SRobert Watson #endif /* !REGRESSION */
150c175d222SRobert Watson 
15145ec3b38SPoul-Henning Kamp char hostname[MAXHOSTNAMELEN];
15245ec3b38SPoul-Henning Kamp 
15375c13541SPoul-Henning Kamp static int
15482d9ae4eSPoul-Henning Kamp sysctl_hostname(SYSCTL_HANDLER_ARGS)
15575c13541SPoul-Henning Kamp {
15675c13541SPoul-Henning Kamp 	int error;
15775c13541SPoul-Henning Kamp 
15891421ba2SRobert Watson 	if (jailed(req->p->p_ucred)) {
15983f1e257SRobert Watson 		if (!jail_set_hostname_allowed && req->newptr)
1606c144e75SRobert Watson 			return(EPERM);
16175c13541SPoul-Henning Kamp 		error = sysctl_handle_string(oidp,
16291421ba2SRobert Watson 		    req->p->p_ucred->cr_prison->pr_host,
16391421ba2SRobert Watson 		    sizeof req->p->p_ucred->cr_prison->pr_host, req);
1646c144e75SRobert Watson 	} else
16575c13541SPoul-Henning Kamp 		error = sysctl_handle_string(oidp,
16675c13541SPoul-Henning Kamp 		    hostname, sizeof hostname, req);
16775c13541SPoul-Henning Kamp 	return (error);
16875c13541SPoul-Henning Kamp }
16975c13541SPoul-Henning Kamp 
17075c13541SPoul-Henning Kamp SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
17175c13541SPoul-Henning Kamp        CTLTYPE_STRING|CTLFLAG_RW|CTLFLAG_PRISON,
1723d177f46SBill Fumerola        0, 0, sysctl_hostname, "A", "Hostname");
17345ec3b38SPoul-Henning Kamp 
174c175d222SRobert Watson #ifdef REGRESSION
175c175d222SRobert Watson int	regression_securelevel_nonmonotonic=0;
176c175d222SRobert Watson 
177c175d222SRobert Watson SYSCTL_INT(_regression, OID_AUTO, securelevel_nonmonotonic, CTLFLAG_RW,
178c175d222SRobert Watson     &regression_securelevel_nonmonotonic, 0, "securelevel may be lowered");
179c175d222SRobert Watson #endif /* !REGRESSION */
180c175d222SRobert Watson 
18145ec3b38SPoul-Henning Kamp int securelevel = -1;
18245ec3b38SPoul-Henning Kamp 
18345ec3b38SPoul-Henning Kamp static int
18482d9ae4eSPoul-Henning Kamp sysctl_kern_securelvl(SYSCTL_HANDLER_ARGS)
18545ec3b38SPoul-Henning Kamp {
18645ec3b38SPoul-Henning Kamp 	int error, level;
18745ec3b38SPoul-Henning Kamp 
1888a528812SRobert Watson 	/*
1899afc1eeeSRobert Watson 	 * If the process is in jail, return the maximum of the global and
1909afc1eeeSRobert Watson 	 * local levels; otherwise, return the global level.
1918a528812SRobert Watson 	 */
1928a528812SRobert Watson 	if (req->p->p_ucred->cr_prison != NULL)
1938a528812SRobert Watson 		level = imax(securelevel,
1948a528812SRobert Watson 		    req->p->p_ucred->cr_prison->pr_securelevel);
1958a528812SRobert Watson 	else
19645ec3b38SPoul-Henning Kamp 		level = securelevel;
19745ec3b38SPoul-Henning Kamp 	error = sysctl_handle_int(oidp, &level, 0, req);
19845ec3b38SPoul-Henning Kamp 	if (error || !req->newptr)
19945ec3b38SPoul-Henning Kamp 		return (error);
2008a528812SRobert Watson 	/*
2018a528812SRobert Watson 	 * Permit update only if the new securelevel exceeds the
2028a528812SRobert Watson 	 * global level, and local level if any.
2038a528812SRobert Watson 	 */
2048a528812SRobert Watson 	if (req->p->p_ucred->cr_prison != NULL) {
205c175d222SRobert Watson #ifdef REGRESSION
206c175d222SRobert Watson 		if (!regression_securelevel_nonmonotonic)
207c175d222SRobert Watson #endif /* !REGRESSION */
2088a528812SRobert Watson 		if (level < imax(securelevel,
2098a528812SRobert Watson 		    req->p->p_ucred->cr_prison->pr_securelevel))
2108a528812SRobert Watson 			return (EPERM);
2118a528812SRobert Watson 			req->p->p_ucred->cr_prison->pr_securelevel = level;
2128a528812SRobert Watson 	} else {
213c175d222SRobert Watson #ifdef REGRESSION
214c175d222SRobert Watson 		if (!regression_securelevel_nonmonotonic)
215c175d222SRobert Watson #endif /* !REGRESSION */
216e16ed081SJoerg Wunsch 		if (level < securelevel)
21745ec3b38SPoul-Henning Kamp 			return (EPERM);
21845ec3b38SPoul-Henning Kamp 		securelevel = level;
2198a528812SRobert Watson 	}
22045ec3b38SPoul-Henning Kamp 	return (error);
22145ec3b38SPoul-Henning Kamp }
22245ec3b38SPoul-Henning Kamp 
2238a528812SRobert Watson SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
2248a528812SRobert Watson     CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl,
2258a528812SRobert Watson     "I", "Current secure level");
226e812e491SRobert Watson 
22745ec3b38SPoul-Henning Kamp char domainname[MAXHOSTNAMELEN];
228949f380fSGarrett Wollman SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
2293d177f46SBill Fumerola     &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
23045ec3b38SPoul-Henning Kamp 
231f83ae79fSJim Pirzyk unsigned long hostid;
232f83ae79fSJim Pirzyk SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
23345ec3b38SPoul-Henning Kamp 
23445ec3b38SPoul-Henning Kamp /*
23545ec3b38SPoul-Henning Kamp  * This is really cheating.  These actually live in the libc, something
23645ec3b38SPoul-Henning Kamp  * which I'm not quite sure is a good idea anyway, but in order for
23745ec3b38SPoul-Henning Kamp  * getnext and friends to actually work, we define dummies here.
23845ec3b38SPoul-Henning Kamp  */
2393d177f46SBill Fumerola SYSCTL_STRING(_user, USER_CS_PATH, cs_path, CTLFLAG_RD,
2403d177f46SBill Fumerola     "", 0, "PATH that finds all the standard utilities");
2413d177f46SBill Fumerola SYSCTL_INT(_user, USER_BC_BASE_MAX, bc_base_max, CTLFLAG_RD,
2423d177f46SBill Fumerola     0, 0, "Max ibase/obase values in bc(1)");
2433d177f46SBill Fumerola SYSCTL_INT(_user, USER_BC_DIM_MAX, bc_dim_max, CTLFLAG_RD,
2443d177f46SBill Fumerola     0, 0, "Max array size in bc(1)");
2453d177f46SBill Fumerola SYSCTL_INT(_user, USER_BC_SCALE_MAX, bc_scale_max, CTLFLAG_RD,
2463d177f46SBill Fumerola     0, 0, "Max scale value in bc(1)");
2473d177f46SBill Fumerola SYSCTL_INT(_user, USER_BC_STRING_MAX, bc_string_max, CTLFLAG_RD,
2483d177f46SBill Fumerola     0, 0, "Max string length in bc(1)");
2493d177f46SBill Fumerola SYSCTL_INT(_user, USER_COLL_WEIGHTS_MAX, coll_weights_max, CTLFLAG_RD,
2503d177f46SBill Fumerola     0, 0, "Maximum number of weights assigned to an LC_COLLATE locale entry");
2517c1aacb5SBruce Evans SYSCTL_INT(_user, USER_EXPR_NEST_MAX, expr_nest_max, CTLFLAG_RD, 0, 0, "");
2523d177f46SBill Fumerola SYSCTL_INT(_user, USER_LINE_MAX, line_max, CTLFLAG_RD,
2533d177f46SBill Fumerola     0, 0, "Max length (bytes) of a text-processing utility's input line");
2543d177f46SBill Fumerola SYSCTL_INT(_user, USER_RE_DUP_MAX, re_dup_max, CTLFLAG_RD,
2553d177f46SBill Fumerola     0, 0, "Maximum number of repeats of a regexp permitted");
2563d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_VERSION, posix2_version, CTLFLAG_RD,
2573d177f46SBill Fumerola     0, 0,
2583d177f46SBill Fumerola     "The version of POSIX 1003.2 with which the system attempts to comply");
2593d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_C_BIND, posix2_c_bind, CTLFLAG_RD,
2603d177f46SBill Fumerola     0, 0, "Whether C development supports the C bindings option");
2613d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_C_DEV, posix2_c_dev, CTLFLAG_RD,
2623d177f46SBill Fumerola     0, 0, "Whether system supports the C development utilities option");
2633d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_CHAR_TERM, posix2_char_term, CTLFLAG_RD,
2643d177f46SBill Fumerola     0, 0, "");
2653d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_FORT_DEV, posix2_fort_dev, CTLFLAG_RD,
2663d177f46SBill Fumerola     0, 0, "Whether system supports FORTRAN development utilities");
2673d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_FORT_RUN, posix2_fort_run, CTLFLAG_RD,
2683d177f46SBill Fumerola     0, 0, "Whether system supports FORTRAN runtime utilities");
2693d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_LOCALEDEF, posix2_localedef, CTLFLAG_RD,
2703d177f46SBill Fumerola     0, 0, "Whether system supports creation of locales");
2713d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_SW_DEV, posix2_sw_dev, CTLFLAG_RD,
2723d177f46SBill Fumerola     0, 0, "Whether system supports software development utilities");
2733d177f46SBill Fumerola SYSCTL_INT(_user, USER_POSIX2_UPE, posix2_upe, CTLFLAG_RD,
2743d177f46SBill Fumerola     0, 0, "Whether system supports the user portability utilities");
2753d177f46SBill Fumerola SYSCTL_INT(_user, USER_STREAM_MAX, stream_max, CTLFLAG_RD,
2763d177f46SBill Fumerola     0, 0, "Min Maximum number of streams a process may have open at one time");
2773d177f46SBill Fumerola SYSCTL_INT(_user, USER_TZNAME_MAX, tzname_max, CTLFLAG_RD,
2783d177f46SBill Fumerola     0, 0, "Min Maximum number of types supported for timezone names");
2796f13bfc2SPoul-Henning Kamp 
2806f13bfc2SPoul-Henning Kamp #include <sys/vnode.h>
2816f13bfc2SPoul-Henning Kamp SYSCTL_INT(_debug_sizeof, OID_AUTO, vnode, CTLFLAG_RD,
2826f13bfc2SPoul-Henning Kamp     0, sizeof(struct vnode), "sizeof(struct vnode)");
2836f13bfc2SPoul-Henning Kamp 
2846f13bfc2SPoul-Henning Kamp SYSCTL_INT(_debug_sizeof, OID_AUTO, proc, CTLFLAG_RD,
2856f13bfc2SPoul-Henning Kamp     0, sizeof(struct proc), "sizeof(struct proc)");
286d7bf417dSPoul-Henning Kamp 
2870ef1c826SPoul-Henning Kamp #include <sys/conf.h>
288d7bf417dSPoul-Henning Kamp SYSCTL_INT(_debug_sizeof, OID_AUTO, specinfo, CTLFLAG_RD,
289d7bf417dSPoul-Henning Kamp     0, sizeof(struct specinfo), "sizeof(struct specinfo)");
2908c125869SPoul-Henning Kamp 
2919626b608SPoul-Henning Kamp #include <sys/bio.h>
2928c125869SPoul-Henning Kamp #include <sys/buf.h>
2938c125869SPoul-Henning Kamp SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
2948c125869SPoul-Henning Kamp     0, sizeof(struct bio), "sizeof(struct bio)");
2958c125869SPoul-Henning Kamp SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD,
2968c125869SPoul-Henning Kamp     0, sizeof(struct buf), "sizeof(struct buf)");
297d5a08a60SJake Burkholder 
298d5a08a60SJake Burkholder #include <sys/user.h>
299d5a08a60SJake Burkholder SYSCTL_INT(_debug_sizeof, OID_AUTO, kinfo_proc, CTLFLAG_RD,
300d5a08a60SJake Burkholder     0, sizeof(struct kinfo_proc), "sizeof(struct kinfo_proc)");
301