xref: /netbsd-src/share/man/man7/sysctl.7 (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1.\"	$NetBSD: sysctl.7,v 1.148 2020/07/13 15:05:05 jruoho Exp $
2.\"
3.\" Copyright (c) 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
31.\"
32.Dd July 13, 2020
33.Dt SYSCTL 7
34.Os
35.Sh NAME
36.Nm sysctl
37.Nd system information variables
38.Sh DESCRIPTION
39The
40.Xr sysctl 3
41library function and the
42.Xr sysctl 8
43utility are used to get and set values of system variables, maintained
44by the kernel.
45The variables are organized in a tree and identified by a sequence of
46numbers, conventionally separated by dots with the topmost identifier
47at the left side.
48The numbers have corresponding text names.
49The
50.Xr sysctlnametomib 3
51function or the
52.Fl M
53argument to the
54.Xr sysctl 8
55utility can be used to convert the text representation to the
56numeric one.
57.Pp
58The individual sysctl variables are described below, both the textual
59and numeric form where applicable.
60The textual names can be used as argument to the
61.Xr sysctl 8
62utility and in the file
63.Pa /etc/sysctl.conf .
64The numeric names are usually defined as preprocessor constants and
65are intended for use by programs.
66Every such constant expands to one integer, which identifies the
67sysctl variable relative to the upper level of the tree.
68See the
69.Xr sysctl 3
70manual page for programming examples.
71.Ss Top level names
72The top level names are defined with a
73.Va CTL_
74prefix in
75.In sys/sysctl.h ,
76and are as follows.
77The next and subsequent levels down are found in the include files
78listed here, and described in separate sections below.
79.Bl -column "security" ".Dv CTL_SECURITY" ".In uvm/uvm_param.h" "High kernel limits"
80.It Sy Name  Ta Sy Constant     Ta Sy Next level names Ta Sy Description
81.It kern     Ta Dv CTL_KERN     Ta In sys/sysctl.h     Ta High kernel limits
82.It vm       Ta Dv CTL_VM       Ta In uvm/uvm_param.h  Ta Virtual memory
83.It vfs      Ta Dv CTL_VFS      Ta In sys/mount.h      Ta Filesystem
84.It net      Ta Dv CTL_NET      Ta In sys/socket.h     Ta Networking
85.It debug    Ta Dv CTL_DEBUG    Ta In sys/sysctl.h     Ta Debugging
86.It hw       Ta Dv CTL_HW       Ta In sys/sysctl.h     Ta Generic CPU, I/O
87.It machdep  Ta Dv CTL_MACHDEP  Ta In sys/sysctl.h     Ta Machine dependent
88.It user     Ta Dv CTL_USER     Ta In sys/sysctl.h     Ta User-level
89.It ddb      Ta Dv CTL_DDB      Ta In sys/sysctl.h     Ta In-kernel debugger
90.It proc     Ta Dv CTL_PROC     Ta In sys/sysctl.h     Ta Per-process
91.It vendor   Ta Dv CTL_VENDOR   Ta ?                   Ta Vendor specific
92.It emul     Ta Dv CTL_EMUL     Ta In sys/sysctl.h     Ta Emulation settings
93.It security Ta Dv CTL_SECURITY Ta In sys/sysctl.h     Ta Security settings
94.El
95.Ss The debug.* subtree
96The debugging variables vary from system to system.
97A debugging variable may be added or deleted without need to recompile
98.Nm
99to know about it.
100Each time it runs,
101.Nm
102gets the list of debugging variables from the kernel and
103displays their current values.
104The system defines twenty
105.Vt ( struct ctldebug )
106variables named
107.Dv debug0
108through
109.Dv debug19 .
110They are declared as separate variables so that they can be
111individually initialized at the location of their associated variable.
112The loader prevents multiple use of the same variable by issuing errors
113if a variable is initialized in more than one place.
114For example, to export the variable
115.Va dospecialcheck
116as a debugging variable, the following declaration would be used:
117.Pp
118.Bd -literal -offset indent -compact
119int dospecialcheck = 1;
120struct ctldebug debug5 = { "dospecialcheck", &dospecialcheck };
121.Ed
122.Pp
123Note that the dynamic implementation of
124.Nm
125currently in use largely makes this particular
126.Nm
127interface obsolete.
128See
129.Xr sysctl 8
130.\" and
131.\" .Xr sysctl 9
132for more information.
133.Ss The vfs.* subtree
134A distinguished second level name,
135.Li vfs.generic ( Dv VFS_GENERIC ) ,
136is used to get general information about all file systems.
137It has the following third level identifiers:
138.Bl -tag -width "123456"
139.It Li vfs.generic.maxtypenum ( Dv VFS_MAXTYPENUM )
140The highest valid file system type number.
141.It Li vfs.generic.conf ( Dv VFS_CONF )
142Returns configuration information about the file system type given as a fourth
143level identifier.
144.It Li vfs.generic.usermount ( Dv VFS_USERMOUNT )
145Determines if non superuser mounts are allowed, defaults to
146.Dv 0 .
147.It Li vfs.generic.magiclinks ( Dv VFS_MAGICLINKS )
148Controls if expansion of variables is going to be performed on pathnames
149or not.
150Defaults to no variable expansion,
151.Dv 0 .
152Variables are of the form
153.Li @name
154and the variables supported are described in
155.Xr symlink 7
156under
157.Dq "MAGIC SYMLINKS" .
158.El
159.Pp
160A second level name for controlling the
161.Xr wapbl 4
162(Write Ahead Physical Block Logging file system journalling)
163capabilities with the following third level identifiers:
164.Bl -tag -width "123456"
165.It Li vfs.wapbl.flush_disk_cache
166Controls whether to attempt to flush the disk cache on each commit.
167It defaults to 1 and it should always be on to ensure integrity
168of file system metadata in the event of a power loss.
169For slow disks, turning it off can improve performance.
170.It Li vfs.wapbl.verbose_commit
171For each transaction log commit, print the number of bytes written
172and the time it took to commit as seconds.nanoseconds.
173.El
174.Pp
175The remaining second level identifiers are the file system names, identified
176by the type number returned by a
177.Xr statvfs 2
178call or from
179.Li vfs.generic.conf .
180.Pp
181The third level identifiers available for each file system
182are given in the header file that defines the mount
183argument structure for that file system.
184.Ss The hw.* subtree
185The string and integer information available for the
186.Li hw
187level is detailed below.
188The changeable column shows whether a process with appropriate
189privilege may change the value.
190.Bl -column "hw.machine_arch" "integer" "Changeable" -offset indent
191.It Sy Second level name Ta Sy Type Ta Sy Changeable
192.It hw.alignbytes	integer	no
193.It hw.byteorder	integer	no
194.It hw.cnmagic	string	yes
195.It hw.disknames	string	no
196.It hw.diskstats	struct	no
197.It hw.machine	string	no
198.It hw.machine_arch	string	no
199.It hw.model	string	no
200.It hw.ncpu	integer	no
201.It hw.ncpuonline	integer	no
202.It hw.pagesize	integer	no
203.It hw.physmem	integer	no
204.It hw.physmem64	quad	no
205.It hw.usermem	integer	no
206.It hw.usermem64	quad	no
207.El
208.Bl -tag -width "123456"
209.It Li hw.alignbytes ( Dv HW_ALIGNBYTES )
210Alignment constraint for all possible data types.
211This shows the value
212.Dv ALIGNBYTES
213in
214.In machine/param.h ,
215at the kernel compilation time.
216.It Li hw.byteorder ( Dv HW_BYTEORDER )
217The byteorder (4321, or 1234).
218.It Li hw.cnmagic ( Dv HW_CNMAGIC )
219The console magic key sequence.
220.It Li hw.disknames ( Dv HW_DISKNAMES )
221The list of (space separated) disk device names on the system.
222.It Li hw.iostatnames ( Dv HW_IOSTATNAMES )
223A space separated list of devices that will have I/O statistics
224collected on them.
225.It Li hw.iostats ( Dv HW_IOSTATS )
226Return statistical information on the NFS mounts, disk and tape
227devices on the system.
228An array of
229.Vt struct io_sysctl
230structures is returned,
231whose size depends on the current number of such objects in the system.
232The third level name is the size of the
233.Vt struct io_sysctl .
234The type of object can be determined by examining the
235.Va type
236element of
237.Vt struct io_sysctl .
238Which can be
239.Dv IOSTAT_DISK
240(disk drive),
241.Dv IOSTAT_TAPE
242(tape drive), or
243.Dv IOSTAT_NFS
244(NFS mount).
245.It Li hw.machine ( Dv HW_MACHINE )
246The machine class.
247.It Li hw.machine_arch ( Dv HW_MACHINE_ARCH )
248The machine CPU class.
249.It Li hw.model ( Dv HW_MODEL )
250The machine model.
251.It Li hw.ncpu ( Dv HW_NCPU )
252The number of CPUs configured.
253.It Li hw.ncpuonline ( Dv HW_NCPUONLINE )
254The number of CPUs online.
255.It Li hw.pagesize ( Dv HW_PAGESIZE )
256The software page size.
257.It Li hw.physmem ( Dv HW_PHYSMEM )
258The bytes of physical memory as a 32-bit integer.
259.It Li hw.physmem64 ( Dv HW_PHYSMEM64 )
260The bytes of physical memory as a 64-bit integer.
261.It Li hw.usermem ( Dv HW_USERMEM )
262The bytes of non-kernel memory as a 32-bit integer.
263.It Li hw.usermem64 ( Dv HW_USERMEM64 )
264The bytes of non-kernel memory as a 64-bit integer.
265.El
266.Ss The kern.* subtree
267This subtree includes data generally related to the kernel.
268The string and integer information available for the
269.Li kern
270level is detailed below.
271The changeable column shows whether a process with appropriate
272privilege may change the value.
273.Bl -column "kern.posix_reader_writer_locks" \
274"struct kinfo_drivers" "not applicable"
275.It Sy Second level name Ta Sy Type Ta Sy Changeable
276.It kern.aio_listio_max	integer	yes
277.It kern.aio_max	integer	yes
278.It kern.arandom	integer	no
279.It kern.argmax	integer	no
280.It kern.boothowto	integer	no
281.It kern.boottime	struct timespec	no
282.It kern.buildinfo	string	no
283.\".It kern.bufq	node	not applicable
284.It kern.ccpu	integer	no
285.It kern.clockrate	struct clockinfo	no
286.It kern.consdev	integer	no
287.It kern.coredump	node	not applicable
288.It kern.cp_id	struct	no
289.It kern.cp_time	uint64_t[\|]	no
290.It kern.cryptodevallowsoft	integer	yes
291.It kern.defcorename	string	yes
292.It kern.detachall	integer	yes
293.It kern.domainname	string	yes
294.It kern.drivers	struct kinfo_drivers	no
295.It kern.dump_on_panic	integer	yes
296.It kern.expose_address	integer	yes
297.It kern.file	struct file	no
298.It kern.forkfsleep	integer	yes
299.It kern.fscale	integer	no
300.It kern.fsync	integer	no
301.It kern.hardclock_ticks	integer	no
302.It kern.hostid	integer	yes
303.It kern.hostname	string	yes
304.It kern.iov_max	integer	no
305.It kern.ipc	node	not applicable
306.It kern.job_control	integer	no
307.It kern.labeloffset	integer	no
308.It kern.labelsector	integer	no
309.It kern.login_name_max	integer	no
310.It kern.logsigexit	integer	yes
311.It kern.lwp	struct kinfo_lwp	yes
312.It kern.mapped_files	integer	no
313.It kern.maxfiles	integer	yes
314.It kern.maxlwp	integer	yes
315.It kern.maxpartitions	integer	no
316.It kern.maxphys	integer	no
317.It kern.maxproc	integer	yes
318.It kern.maxptys	integer	yes
319.It kern.maxvnodes	integer	yes
320.It kern.messages	integer	yes
321.It kern.mbuf	node	not applicable
322.It kern.memlock	integer	no
323.It kern.memlock_range	integer	no
324.It kern.memory_protection	integer	no
325.It kern.module	node	not applicable
326.It kern.monotonic_clock	integer	no
327.It kern.mqueue	node	not applicable
328.It kern.msgbuf	integer	no
329.It kern.msgbufsize	integer	no
330.It kern.ngroups	integer	no
331.\".It kern.no_sa_support	integer	yes
332.It kern.ntptime	struct ntptimeval	no
333.It kern.osrelease	string	no
334.It kern.osrevision	integer	no
335.It kern.ostype	string	no
336.\".It kern.panic_now	integer	yes
337.It kern.pipe	node	not applicable
338.It kern.pool	struct pool_sysctl	no
339.\" .It kern.posix	node	not applicable
340.It kern.posix1version	integer	no
341.It kern.posix_aio	integer	no
342.It kern.posix_barriers	integer	no
343.It kern.posix_reader_writer_locks	integer	no
344.\".It kern.posix_sched	integer	yes
345.It kern.posix_semaphores	integer	no
346.It kern.posix_spin_locks	integer	no
347.It kern.posix_threads	integer	no
348.It kern.posix_timers	integer	no
349.It kern.proc	struct kinfo_proc	no
350.It kern.proc2	struct kinfo_proc2	no
351.It kern.proc_args	string	no
352.It kern.profiling	node	not applicable
353.\".It kern.pset	node	not applicable
354.It kern.rawpartition	integer	no
355.It kern.root_device	string	no
356.It kern.root_partition	integer	no
357.It kern.rtc_offset	integer	yes
358.It kern.saved_ids	integer	no
359.It kern.sbmax	integer	yes
360.It kern.sched	node	not applicable
361.It kern.securelevel	integer	raise only
362.It kern.somaxkva	integer	yes
363.It kern.sooptions	integer	yes
364.It kern.synchronized_io	integer	no
365.It kern.timecounter	node	not applicable
366.It kern.timex	struct	no
367.It kern.tkstat	node	not applicable
368.It kern.tty	node	not applicable
369.It kern.urandom	integer	no
370.It kern.usercrypto	integer	yes
371.It kern.userasymcrypto	integer	yes
372.It kern.veriexec	node	not applicable
373.It kern.version	string	no
374.It kern.vnode	struct vnode	no
375.El
376.Bl -tag -width "123456"
377.It Li kern.aio_listio_max
378The maximum number of asynchronous I/O operations in a single list
379I/O call.
380Like with all variables related to
381.Xr aio 3 ,
382the variable may be created and removed dynamically
383upon loading or unloading the corresponding kernel module.
384.It Li kern.aio_max
385The maximum number of asynchronous I/O operations.
386.It Li kern.arandom ( Dv KERN_ARND )
387Returns independent uniformly distributed bytes at random each time, as
388many as requested up to 256, derived from the system entropy pool; see
389.Xr rnd 4 .
390.Pp
391Reading
392.Li kern.arandom
393is equivalent to reading up to 256 bytes at a time from
394.Pa /dev/urandom :
395reading
396.Li kern.arandom
397never blocks, and once the system entropy pool has full entropy, output
398subsequently read from
399.Li kern.arandom
400is fit for use as cryptographic key material.
401For example, the
402.Xr arc4random 3
403library routine uses
404.Li kern.arandom
405internally to seed a cryptographic pseudorandom number generator.
406.It Li kern.argmax ( Dv KERN_ARGMAX )
407The maximum bytes of argument to
408.Xr execve 2 .
409.It Li kern.boothowto
410Flags passed from the boot loader; see
411.Xr reboot 2
412for the meanings of the flags.
413.It Li kern.boottime ( Dv KERN_BOOTTIME )
414A
415.Vt struct timespec
416structure is returned.
417This structure contains the time that the system was booted.
418That time is defined (for this purpose) to be the time at
419which the kernel first started accumulating clock ticks.
420.It Li kern.bufq
421This variable contains information on the
422.Xr bufq 9
423subsystem.
424Currently, the only third level name implemented is
425.Dv kern.bufq.strategies
426which provides a list of buffer queue strategies currently available.
427.It Li kern.buildinfo
428When the kernel is built, the build environment may optionally provide
429arbitrary information to be stored in this variable.
430.It Li kern.ccpu ( Dv KERN_CCPU )
431The scheduler exponential decay value.
432.It Li kern.clockrate ( Dv KERN_CLOCKRATE )
433A
434.Vt struct clockinfo
435structure is returned.
436This structure contains the clock, statistics clock and profiling clock
437frequencies, the number of micro-seconds per hz tick, and the clock
438skew rate.
439Refer to
440.Xr hz 9
441for additional details.
442.It Li kern.consdev ( Dv KERN_CONSDEV )
443Console device.
444.It Li kern.coredump
445Settings related to set-id processes coredumps.
446By default, set-id processes do not dump core in situations where
447other processes would.
448The settings in this node allows an administrator to change this
449behavior.
450.Pp
451The third level name is
452.Dv kern.coredump.setid
453and fourth level variables are described below.
454.Bl -column "kern.coredump.setid.group" "integer" "Changeable" -offset indent
455.It Sy Fourth level name Ta Sy Type Ta Sy Changeable
456.It kern.coredump.setid.dump	integer	yes
457.It kern.coredump.setid.group	integer	yes
458.It kern.coredump.setid.mode	integer	yes
459.It kern.coredump.setid.owner	integer	yes
460.It kern.coredump.setid.path	string	yes
461.El
462.Bl -tag -width "123456"
463.It Li kern.coredump.setid.dump
464If non-zero, set-id processes will dump core.
465.It Li kern.coredump.setid.group
466The group-id for the set-id processes' coredump.
467.It Li kern.coredump.setid.mode
468The mode for the set-id processes' coredump.
469See
470.Xr chmod 1 .
471.It Li kern.coredump.setid.owner
472The user-id that will be used as the owner of the set-id processes'
473coredump.
474.It Li kern.coredump.setid.path
475The path to which set-id processes' coredumps will be saved to.
476Same syntax as kern.defcorename.
477.El
478.It Li kern.cp_id ( Dv KERN_CP_ID )
479Mapping of CPU number to CPU id.
480.It Li kern.cp_time ( Dv KERN_CP_TIME )
481Returns an array of
482.Dv CPUSTATES
483.Vt uint64_t Ns s .
484This array contains the
485number of clock ticks spent in different CPU states.
486On multi-processor systems, the sum across all CPUs is returned unless
487appropriate space is given for one data set for each CPU.
488Data for a specific CPU can also be obtained by adding the number of the
489CPU at the end of the MIB, enlarging it by one.
490.It Li kern.cryptodevallowsoft
491This variable controls userland access to hardware versus software transforms
492in the
493.Xr crypto 4
494system.
495The available values are as follows:
496.Bl -tag -width XX0 -offset indent
497.It Dv < 0
498Always force userlevel requests to use software transforms.
499.It Dv = 0
500If present, use hardware and grant userlevel requests for
501non-accelerated transforms (handling the latter in software).
502.It Dv > 0
503Allow user requests only for transforms which are hardware-accelerated.
504.El
505.It Li kern.defcorename ( Dv KERN_DEFCORENAME )
506Default template for the name of core dump files (see also
507.Li proc.pid.corename
508in the per-process variables
509.Li proc.* ,
510and
511.Xr core 5
512for format of this template).
513The default value is
514.Pa %n.core
515and can be changed with the kernel configuration option
516.Cd options DEFCORENAME
517(see
518.Xr options 4
519).
520.It Li kern.detachall
521Detach all devices at shutdown.
522.It Li kern.domainname ( Dv KERN_DOMAINNAME )
523Get or set the YP domain name.
524.It Li kern.drivers ( Dv KERN_DRIVERS )
525Return an array of
526.Vt struct kinfo_drivers
527that contains the name and major device numbers of all the device drivers
528in the current kernel.
529The
530.Va d_name
531field is always a NUL terminated string.
532The
533.Va d_bmajor
534field will be set to \-1 if the driver doesn't have a block device.
535.It Li kern.expose_address
536Expose kernel addresses in
537.Xr sysctl 3
538calls used by
539.Xr fstat 1
540and
541.Xr sockstat 1 .
542If it is set to
543.Dv 0
544access is not allowed.
545If it is set to
546.Dv 1
547then only processes that have opened
548.Pa /dev/kmem
549can have access.
550If it is set to
551.Dv 2
552every process is allowed.
553Defaults to
554.Dv 0
555for
556.Dv KASLR
557kernels
558and
559.Dv 1
560otherwise.
561Allowing general access renders KASLR ineffective; allowing only kmem
562accessing programs weakens KASLR if those programs can be subverted
563to leak the addresses.
564.It Li kern.dump_on_panic ( Dv KERN_DUMP_ON_PANIC )
565Perform a crash dump on system
566.Xr panic 9 .
567.It Li kern.file ( Dv KERN_FILE )
568Return the entire file table.
569The returned data consists of a single
570.Vt struct filelist
571followed by an array of
572.Vt struct file ,
573whose size depends on the current number of such objects in the system.
574.It Li kern.forkfsleep ( Dv KERN_FORKFSLEEP )
575If
576.Xr fork 2
577system call fails due to limit on number of processes (either
578the global maxproc limit or user's one), wait for this many
579milliseconds before returning
580.Er EAGAIN
581error to process.
582Useful to keep heavily forking runaway processes in bay.
583Default zero (no sleep).
584Maximum is 20 seconds.
585.It Li kern.fscale ( Dv KERN_FSCALE )
586The kernel fixed-point scale factor.
587.It Li kern.fsync ( Dv KERN_FSYNC )
588Return 1 if the
589.St -p1003.1b-93
590File Synchronization Option is available
591on this system,
592otherwise\ 0.
593.It Li kern.hardclock_ticks ( Dv KERN_HARDCLOCK_TICKS )
594Returns the number of
595.Xr hardclock 9
596ticks.
597.It Li kern.hist
598This variable contains kernel history data if the kernel was
599configured for any of the options
600.Dv UVHMIST ,
601.Dv USB_DEBUG ,
602.Dv BIOHIST ,
603or
604.Dv SCDEBUG .
605(See
606.Xr options 4
607for more details.)
608The third-level names correspond to each available history table.
609The values of the history tables are in an internal format, and can be
610decoded by the
611.Xr vmstat 1
612utility's
613.Fl U
614and
615.Fl u
616options;
617the
618.Fl l
619option can be used to see which tables are available.
620.It Li kern.hostid ( Dv KERN_HOSTID )
621Get or set the host identifier.
622This is aimed to replace the legacy
623.Xr gethostid 3
624and
625.Xr sethostid 3
626system calls.
627.It Li kern.hostname ( Dv KERN_HOSTNAME )
628Get or set the
629.Xr hostname 1 .
630.It Li kern.iov_max ( Dv KERN_IOV_MAX )
631Return the maximum number of
632.Vt iovec
633structures that a process has available for use with
634.Xr preadv 2 ,
635.Xr pwritev 2 ,
636.Xr readv 2 ,
637.Xr recvmsg 2 ,
638.Xr sendmsg 2
639and
640.Xr writev 2 .
641.It Li kern.ipc ( Dv KERN_SYSVIPC )
642Return information about the SysV IPC parameters.
643The third level names for the ipc variables are detailed below.
644.Bl -column "kern.ipc.shm_use_phys" "integer" "Changeable" -offset indent
645.It Sy Third level name Ta Sy Type Ta Sy Changeable
646.It kern.ipc.sysvmsg	integer	no
647.It kern.ipc.sysvsem	integer	no
648.It kern.ipc.sysvshm	integer	no
649.It kern.ipc.sysvipc_info	struct	no
650.It kern.ipc.shmmax	integer	yes
651.It kern.ipc.shmmni	integer	yes
652.It kern.ipc.shmseg	integer	yes
653.It kern.ipc.shmmaxpgs	integer	yes
654.It kern.ipc.shm_use_phys	integer	yes
655.It kern.ipc.msgmni	integer	yes
656.It kern.ipc.msgseg	integer	yes
657.It kern.ipc.semmni	integer	yes
658.It kern.ipc.semmns	integer	yes
659.It kern.ipc.semmnu	integer	yes
660.El
661.Bl -tag -width "123456"
662.It Li kern.ipc.sysvmsg ( Dv KERN_SYSVIPC_MSG )
663Returns 1 if System V style message queue functionality is available
664on this system,
665otherwise\ 0.
666.It Li kern.ipc.sysvsem ( Dv KERN_SYSVIPC_SEM )
667Returns 1 if System V style semaphore functionality is available
668on this system,
669otherwise\ 0.
670.It Li kern.ipc.sysvshm ( Dv KERN_SYSVIPC_SHM )
671Returns 1 if System V style share memory functionality is available
672on this system,
673otherwise\ 0.
674.It Li kern.ipc.sysvipc_info ( Dv KERN_SYSVIPC_INFO )
675Return System V style IPC configuration and run-time information.
676The fourth level name selects the System V style IPC facility.
677.Bl -column "KERN_SYSVIPC_MSG_INFO" "struct shm_sysctl_info" -offset indent
678.It Sy Fourth level name Ta Sy Type
679.It KERN_SYSVIPC_MSG_INFO	struct msg_sysctl_info
680.It KERN_SYSVIPC_SEM_INFO	struct sem_sysctl_info
681.It KERN_SYSVIPC_SHM_INFO	struct shm_sysctl_info
682.El
683.Bl -tag -width "123456"
684.It Li KERN_SYSVIPC_MSG_INFO
685Return information on the System V style message facility.
686The
687.Sy msg_sysctl_info
688structure is defined in
689.In sys/msg.h .
690.It Li KERN_SYSVIPC_SEM_INFO
691Return information on the System V style semaphore facility.
692The
693.Sy sem_sysctl_info
694structure is defined in
695.In sys/sem.h .
696.It Li KERN_SYSVIPC_SHM_INFO
697Return information on the System V style shared memory facility.
698The
699.Sy shm_sysctl_info
700structure is defined in
701.In sys/shm.h .
702.El
703.It Li kern.ipc.shmmax ( Dv KERN_SYSVIPC_SHMMAX )
704Max shared memory segment size in bytes.
705.It Li kern.ipc.shmmni ( Dv KERN_SYSVIPC_SHMMNI )
706Max number of shared memory identifiers.
707.It Li kern.ipc.shmseg ( Dv KERN_SYSVIPC_SHMSEG )
708Max shared memory segments per process.
709.It Li kern.ipc.shmmaxpgs ( Dv KERN_SYSVIPC_SHMMAXPGS )
710Max amount of shared memory in pages.
711.It Li kern.ipc.shm_use_phys ( Dv KERN_SYSVIPC_SHMUSEPHYS )
712Locking of shared memory in physical memory.
713If 0, memory can be swapped
714out, otherwise it will be locked in physical memory.
715.It Li kern.ipc.msgmni
716Max number of message queue identifiers.
717.It Li kern.ipc.msgseg
718Max number of number of message segments.
719.It Li kern.ipc.semmni
720Max number of number of semaphore identifiers.
721.It Li kern.ipc.semmns
722Max number of number of semaphores in system.
723.It Li kern.ipc.semmnu
724Max number of undo structures in system.
725.El
726.It Li kern.job_control ( Dv KERN_JOB_CONTROL )
727Return 1 if job control is available on this system, otherwise\ 0.
728.It Li kern.labeloffset ( Dv KERN_LABELOFFSET )
729The offset within the sector specified by
730.Dv KERN_LABELSECTOR
731of the
732.Xr disklabel 5 .
733.It Li kern.labelsector ( Dv KERN_LABELSECTOR )
734The sector number containing the
735.Xr disklabel 5 .
736.It Li kern.login_name_max ( Dv KERN_LOGIN_NAME_MAX )
737The size of the storage required for a login name, in bytes,
738including the terminating NUL.
739.It Li kern.logsigexit ( Dv KERN_LOGSIGEXIT )
740If this flag is non-zero, the kernel will
741.Xr log 9
742all process exits due to signals which create a
743.Xr core 5
744file, and whether the coredump was created.
745.It Li kern.lwp ( Dv KERN_LWP )
746Returns information about the current light-weight process.
747The
748.Sy kinfo_lwp
749structure is defined in
750.In sys/sysctl.h .
751.It Li kern.mapped_files ( Dv KERN_MAPPED_FILES )
752Returns 1 if the
753.St -p1003.1b-93
754Memory Mapped Files Option is available on this system,
755otherwise\ 0.
756.It Li kern.maxfiles ( Dv KERN_MAXFILES )
757The maximum number of open files that may be open in the system.
758.It Li kern.maxpartitions ( Dv KERN_MAXPARTITIONS )
759The maximum number of partitions allowed per disk.
760.It Li kern.maxlwp
761The maximum number of Lightweight Processes (threads) the system allows
762per uid.
763.It Li kern.maxphys ( Dv KERN_MAXPHYS )
764Maximum raw I/O transfer size.
765.It Li kern.maxproc ( Dv KERN_MAXPROC )
766The maximum number of simultaneous processes the system will allow.
767.It Li kern.maxptys ( Dv KERN_MAXPTYS )
768The maximum number of pseudo terminals.
769This value can be both raised and lowered, though it cannot
770be set lower than number of currently used ptys.
771See also
772.Xr pty 4 .
773.It Li kern.maxvnodes ( Dv KERN_MAXVNODES )
774The maximum number of vnodes available on the system.
775This can only be raised.
776.It Li kern.mbuf ( Dv KERN_MBUF )
777Return information about the mbuf control variables.
778Mbufs are data structures which store network packets and other data
779structures in the networking code, see
780.Xr mbuf 9 .
781The third level names for the mbuf variables are detailed below.
782The changeable column shows whether a process with appropriate
783privilege may change the value.
784.Bl -column "kern.mbuf.nmbclusters" "integer" "Changeable" -offset indent
785.It Sy Third level name Ta Sy Type Ta Sy Changeable
786.\" XXX Changeable? really?
787.It kern.mbuf.mblowat	integer	yes
788.It kern.mbuf.mclbytes	integer	yes
789.It kern.mbuf.mcllowat	integer	yes
790.It kern.mbuf.msize	integer	yes
791.It kern.mbuf.nmbclusters	integer	yes
792.El
793.Pp
794The variables are as follows:
795.Bl -tag -width "123456"
796.It Li kern.mbuf.mblowat ( Dv MBUF_MBLOWAT )
797The mbuf low water mark.
798.It Li kern.mbuf.mclbytes ( Dv MBUF_MCLBYTES )
799The mbuf cluster size.
800.It Li kern.mbuf.mcllowat ( Dv MBUF_MCLLOWAT )
801The mbuf cluster low water mark.
802.It Li kern.mbuf.msize ( Dv MBUF_MSIZE )
803The mbuf base size.
804.It Li kern.mbuf.nmbclusters ( Dv MBUF_NMBCLUSTERS )
805The limit on the number of mbuf clusters.
806The variable can only be increased, and only increased on machines with
807direct-mapped pool pages.
808.El
809.It Li kern.memlock ( Dv KERN_MEMLOCK )
810Returns 1 if the
811.St -p1003.1b-93
812Process Memory Locking Option is available on this system,
813otherwise\ 0.
814.It Li kern.memlock_range ( Dv KERN_MEMLOCK_RANGE )
815Returns 1 if the
816.St -p1003.1b-93
817Range Memory Locking Option is available on this system,
818otherwise\ 0.
819.It Li kern.memory_protection ( Dv KERN_MEMORY_PROTECTION )
820Returns 1 if the
821.St -p1003.1b-93
822Memory Protection Option is available on this system,
823otherwise\ 0.
824.It Li kern.messages
825Kernel console message verbosity.
826See
827.Aq Pa sys/reboot.h
828.Bl -column "verbosity" "setting" -offset indent
829.It Sy Value Ta Sy Verbosity Ta Sy sys/reboot.h equivalent
830.It 0 Ta Silent Ta Sy AB_SILENT
831.It 1 Ta Quiet Ta Sy AB_QUIET
832.It 2 Ta Normal Ta Sy AB_NORMAL
833.It 3 Ta Verbose Ta Sy AB_VERBOSE
834.It 4 Ta Debug Ta Sy AB_DEBUG
835.El
836.It Li kern.module
837Settings related to kernel modules.
838The third level names for the settings are described below.
839.Bl -column "kern.module.autoload" "integer" "Changeable" -offset indent
840.It Sy Third level name Ta Sy Type Ta Sy Changeable
841.It kern.module.autoload	integer	yes
842.It kern.module.autotime	integer	yes
843.It kern.module.verbose	boolean	yes
844.El
845.Pp
846The variables are as follows:
847.Bl -tag -width "123456"
848.It Li kern.module.autoload
849A boolean that controls whether kernel modules are loaded automatically.
850See
851.Xr module 7
852for additional details.
853.It Li kern.module.autotime
854An integer that controls the delay before an attempt is made to
855automatically unload a module that was auto-loaded.
856Setting this value to zero disables the auto-unload function.
857.It Li kern.module.verbose
858A boolean that enables or disables verbose
859debug messages related to kernel modules.
860.El
861.It Li kern.monotonic_clock ( Dv KERN_MONOTONIC_CLOCK )
862Returns the standard version the implementation of the
863.St -p1003.1b-93
864Monotonic Clock Option conforms to,
865otherwise\ 0.
866.It Li kern.mqueue
867Settings related to POSIX message queues; see
868.Xr mqueue 3 .
869This node is created dynamically when
870the corresponding kernel module is loaded.
871The third level names for the settings are described below.
872.Bl -column "kern.mqueue.mq_max_msgsize" "integer" "Changeable" -offset indent
873.It Sy Third level name Ta Sy Type Ta Sy Changeable
874.It kern.mqueue.mq_open_max	integer	yes
875.It kern.mqueue.mq_prio_max	integer	yes
876.It kern.mqueue.mq_max_msgsize	integer	yes
877.It kern.mqueue.mq_def_maxmsg	integer	yes
878.It kern.mqueue.mq_max_maxmsg	integer	yes
879.El
880.Pp
881The variables are:
882.Bl -tag -width "123456"
883.It Li kern.mqueue.mq_open_max
884The maximum number of message queue descriptors any single process can open.
885.It Li kern.mqueue.mq_prio_max
886The maximum priority of a message.
887.It Li kern.mqueue.mq_max_msgsize
888The maximum size of a message in a message queue.
889.It Li kern.mqueue.mq_def_maxmsg
890The default maximum message count.
891.It Li kern.mqueue.mq_max_maxmsg
892The maximum number of messages in a message queue.
893.El
894.It Li kern.msgbuf ( Dv KERN_MSGBUF )
895The kernel message buffer, rotated so that the head of the circular kernel
896message buffer is at the start of the returned data.
897The returned data may contain NUL bytes.
898.It Li kern.msgbufsize ( Dv KERN_MSGBUFSIZE )
899The maximum number of characters that the kernel message buffer can hold.
900.It Li kern.ngroups ( Dv KERN_NGROUPS )
901The maximum number of supplemental groups.
902.\" .It Li kern.no_sa_support
903.\" XXX: Undocumented.
904.It Li kern.ntptime ( Dv KERN_NTPTIME )
905A
906.Vt struct ntptimeval
907structure is returned.
908This structure contains data used by the
909.Xr ntpd 8
910program.
911.It Li kern.osrelease ( Dv KERN_OSRELEASE )
912The system release string.
913.It Li kern.osrevision ( Dv KERN_OSREV )
914The system revision string.
915.It Li kern.ostype ( Dv KERN_OSTYPE )
916The system type string.
917.\".It Li kern.panic_now
918.\" XXX: Undocumented.
919.It Li kern.pipe ( Dv KERN_PIPE )
920Pipe settings.
921The third level names for the  integer pipe settings is detailed below.
922The changeable column shows whether a process with appropriate
923privilege may change the value.
924.Bl -column "kern.pipe.maxbigpipes" "integer" "Changeable" -offset indent
925.It Sy Third level name Ta Sy Type Ta Sy Changeable
926.It kern.pipe.kvasiz	integer	yes
927.It kern.pipe.maxbigpipes	integer	yes
928.It kern.pipe.maxkvasz	integer	yes
929.It kern.pipe.limitkva	integer	yes
930.It kern.pipe.nbigpipes	integer	yes
931.El
932.Pp
933The variables are as follows:
934.Bl -tag -width "123456"
935.It Li kern.pipe.kvasiz ( Dv KERN_PIPE_KVASIZ )
936Amount of kernel memory consumed by pipe buffers.
937.It Li kern.pipe.maxbigpipes ( Dv KERN_PIPE_MAXBIGPIPES )
938Maximum number of
939.Dq big
940pipes.
941.It Li kern.pipe.maxkvasz ( Dv KERN_PIPE_MAXKVASZ )
942Maximum amount of kernel memory to be used for pipes.
943.It Li kern.pipe.limitkva ( Dv KERN_PIPE_LIMITKVA )
944Limit for direct transfers via page loan.
945.It Li kern.pipe.nbigpipes ( Dv KERN_PIPE_NBIGPIPES )
946Number of
947.Dq big
948pipes.
949.El
950.It Li kern.pool
951Provides statistics about the
952.Xr pool 9
953and
954.Xr pool_cache 9
955subsystems.
956.\" XXX: Undocumented .It Li kern.posix ( ? )
957.\"	 This is a node in which the only variable is semmax.
958.It Li kern.posix1version ( Dv KERN_POSIX1 )
959The version of ISO/IEC 9945
960.Pq St -p1003.1
961with which the system attempts to comply.
962.It Li kern.posix_aio
963The version of
964.St -p1003.1
965and its Asynchronous I/O option to which the system attempts to conform.
966.It Li kern.posix_barriers ( Dv KERN_POSIX_BARRIERS )
967The version of
968.St -p1003.1
969and its
970Barriers
971option to which the system attempts to conform,
972otherwise\ 0.
973.It Li kern.posix_reader_writer_locks ( Dv KERN_POSIX_READER_WRITER_LOCKS )
974The version of
975.St -p1003.1
976and its
977Read-Write Locks
978option to which the system attempts to conform,
979otherwise\ 0.
980.\".It Li kern.posix_sched
981.\" XXX: Undocumented.
982.It Li kern.posix_semaphores ( Dv KERN_POSIX_SEMAPHORES )
983The version of
984.St -p1003.1
985and its
986Semaphores
987option to which the system attempts to conform,
988otherwise\ 0.
989.It Li kern.posix_spin_locks ( Dv KERN_POSIX_SPIN_LOCKS )
990The version of
991.St -p1003.1
992and its
993Spin Locks
994option to which the system attempts to conform,
995otherwise\ 0.
996.It Li kern.posix_threads ( Dv KERN_POSIX_THREADS )
997The version of
998.St -p1003.1
999and its
1000Threads
1001option to which the system attempts to conform,
1002otherwise\ 0.
1003.It Li kern.posix_timers ( Dv KERN_POSIX_TIMERS )
1004The version of
1005.St -p1003.1
1006and its
1007Timers
1008option to which the system attempts to conform,
1009otherwise\ 0.
1010.It Li kern.proc ( Dv KERN_PROC )
1011Return the entire process table, or a subset of it.
1012An array of
1013.Vt struct kinfo_proc
1014structures is returned,
1015whose size depends on the current number of such objects in the system.
1016The third and fourth level numeric names are as follows:
1017.Bl -column "KERN_PROC_SESSION" "Fourth level is:" -offset indent
1018.It Sy Third level name Ta Sy Fourth level is :
1019.It KERN_PROC_ALL	None
1020.It KERN_PROC_GID	A group ID
1021.It KERN_PROC_PID	A process ID
1022.It KERN_PROC_PGRP	A process group
1023.It KERN_PROC_RGID	A real group ID
1024.It KERN_PROC_RUID	A real user ID
1025.It KERN_PROC_SESSION	A session ID
1026.It KERN_PROC_TTY	A tty device
1027.It KERN_PROC_UID	A user ID
1028.El
1029.It Li kern.proc2 ( Dv KERN_PROC2 )
1030As for
1031.Dv KERN_PROC ,
1032but an array of
1033.Vt struct kinfo_proc2
1034structures are returned.
1035The fifth level name is the size of the
1036.Vt struct kinfo_proc2
1037and the sixth level name is the number of structures to return.
1038.It Li kern.proc_args ( Dv KERN_PROC_ARGS )
1039Return the argv or environment strings (or the number thereof)
1040of a process.
1041Multiple strings are returned separated by NUL characters.
1042The third level name is the process ID.
1043The fourth level name is as follows:
1044.Bl -column "KERN_PROG_PATHNAME" "The full pathname of the executable" -offset indent
1045.It Dv KERN_PROC_ARGV	The argv strings
1046.It Dv KERN_PROC_ENV	The environ strings
1047.It Dv KERN_PROC_NARGV	The number of argv strings
1048.It Dv KERN_PROC_NENV	The number of environ strings
1049.It Dv KERN_PROC_PATHNAME	The full pathname of the executable
1050.It Dv KERN_PROC_CWD	The current working directory
1051.El
1052.It Li kern.profiling ( Dv KERN_PROF )
1053Return profiling information about the kernel.
1054If the kernel is not compiled for profiling,
1055attempts to retrieve any of the
1056.Dv KERN_PROF
1057values will fail with
1058.Er EOPNOTSUPP .
1059The third level names for the string and integer profiling information
1060is detailed below.
1061The changeable column shows whether a process with appropriate
1062privilege may change the value.
1063.Bl -column "kern.profiling.gmonparam" "struct gmonparam" "Changeable" -offset indent
1064.It Sy Third level name Ta Sy Type Ta Sy Changeable
1065.It kern.profiling.count	u_short[\|]	yes
1066.It kern.profiling.froms	u_short[\|]	yes
1067.It kern.profiling.gmonparam	struct gmonparam	no
1068.It kern.profiling.state	integer	yes
1069.It kern.profiling.tos	struct tostruct	yes
1070.El
1071.Pp
1072The variables are as follows:
1073.Bl -tag -width "123456"
1074.It Li kern.profiling.count ( Dv GPROF_COUNT )
1075Array of statistical program counter counts.
1076.It Li kern.profiling.froms ( Dv GPROF_FROMS )
1077Array indexed by program counter of call-from points.
1078.It Li kern.profiling.gmonparams ( Dv GPROF_GMONPARAM )
1079Structure giving the sizes of the above arrays.
1080.It Li kern.profiling.state ( Dv GPROF_STATE )
1081Profiling state.
1082If set to
1083.Dv GMON_PROF_ON ,
1084starts profiling.
1085If set to
1086.Dv GMON_PROF_OFF ,
1087stops profiling.
1088.It Li kern.profiling.tos ( Dv GPROF_TOS )
1089Array of
1090.Vt struct tostruct
1091describing destination of calls and their counts.
1092.El
1093.\" .It Li kern.pset
1094.\" XXX: Undocumented.
1095.It Li kern.rawpartition ( Dv KERN_RAWPARTITION )
1096The raw partition of a disk (a == 0).
1097.It Li kern.root_device ( Dv KERN_ROOT_DEVICE )
1098The name of the root device (e.g.,
1099.Dq wd0 ) .
1100.It Li kern.root_partition ( Dv KERN_ROOT_PARTITION )
1101The root partition on the root device (a == 0).
1102.It Li kern.rtc_offset ( Dv KERN_RTC_OFFSET )
1103Return the offset of real time clock from UTC in minutes.
1104.It Li kern.saved_ids ( Dv KERN_SAVED_IDS )
1105Returns 1 if saved set-group and saved set-user ID is available.
1106.It Li kern.sbmax ( Dv KERN_SBMAX )
1107Maximum socket buffer size in bytes.
1108.It Li kern.securelevel ( Dv KERN_SECURELVL )
1109See
1110.Xr secmodel_securelevel 9 .
1111.It Li kern.sched ( dynamic )
1112Influence the scheduling of LWPs, their priorisation and how they are
1113distributed on and moved between CPUs.
1114.Bl -column "kern.sched.balance_period" "integer" "Changeable" -offset indent
1115.It Sy Third level name	   Sy Type	 Sy Changeable
1116.It kern.sched.cacheht_time	   integer	 yes
1117.It kern.sched.balance_period	   integer	 yes
1118.It kern.sched.average_weight	   integer	 yes
1119.It kern.sched.min_catch	   integer	 yes
1120.It kern.sched.timesoftints	   integer	 yes
1121.It kern.sched.kpreempt_pri	   integer	 yes
1122.It kern.sched.upreempt_pri	   integer	 yes
1123.It kern.sched.maxts	   integer	 yes
1124.It kern.sched.mints	   integer	 yes
1125.It kern.sched.name	   string	 no
1126.It kern.sched.rtts	   integer	 no
1127.It kern.sched.pri_min	   integer	 no
1128.It kern.sched.pri_max	   integer	 no
1129.El
1130.Pp
1131The variables are as follows:
1132.Bl -tag -width "123456"
1133.It Li kern.sched.cacheht_time ( dynamic )
1134Cache hotness time in which a LWP is kept on one particular CPU
1135and not moved to another CPU.
1136This reduces the overhead of flushing and reloading caches.
1137Defaults to 3ms.
1138Needs to be given in
1139.Dq hz
1140units, see
1141.Xr mstohz 9 .
1142.It Li kern.sched.balance_period ( dynamic )
1143Interval at which the CPU queues are checked for re-balancing.
1144Defaults to 300ms.
1145Needs to be given in
1146.Dq hz
1147units, see
1148.Xr mstohz 9 .
1149.It Li kern.sched.average_weight ( dynamic )
1150Can be used to influence how likely LWPs are to be migrated from
1151one CPU's queue of LWPs that are ready to run to a different, idle CPU.
1152The value gives the percentage for weighting the average count of
1153migratable threads from the past against the current number of
1154migratable threads.
1155A small value gives more weight to the past, a larger values more weight
1156on the current situation.
1157Defaults to 50 and must be between 0 and 100.
1158.It Li kern.sched.min_catch ( dynamic )
1159Minimum count of migratable (runable) threads for catching (stealing)
1160from another CPU.
1161Defaults to 1 but can be increased to decrease chance of thread
1162migration between CPUs.
1163.It Li kern.sched.timesoftints ( dynamic )
1164Enable tracking of CPU time for soft interrupts
1165as part of a LWP's real execution time.
1166Set to a non-zero value to enable,
1167and see
1168.Xr ps 1
1169for printing CPU times.
1170.It Li kern.sched.kpreempt_pri ( dynamic )
1171Minimum priority to trigger kernel preemption.
1172.It Li kern.sched.upreempt_pri ( dynamic )
1173Minimum priority to trigger user preemption.
1174.It Li kern.sched.maxts ( dynamic )
1175Scheduler specific maximal time quantum (in milliseconds).
1176Must be set to a value larger than
1177.Dq mints
1178and between 10 and
1179.Dq hz
1180as given by the
1181.Dv kern.clockrate
1182sysctl.
1183Provided by the M2 scheduler.
1184.It Li kern.sched.mints ( dynamic )
1185Scheduler specific minimal time quantum (in milliseconds).
1186Must be set to a value smaller than
1187.Dq maxts
1188and between 1 and
1189.Dq hz
1190as given by the
1191.Dq kern.clockrate
1192sysctl.
1193Provided by the M2 scheduler.
1194.It Li kern.sched.name ( dynamic )
1195Scheduler name.
1196Provided both by the M2 and the 4BSD scheduler.
1197.It Li kern.sched.rtts ( dynamic )
1198Fixed scheduler specific round-robin time quantum in milliseconds.
1199Provided both by the M2 and the 4BSD scheduler.
1200.It Li kern.sched.pri_min ( dynamic )
1201Minimal POSIX real-time priority.
1202See
1203.Xr sched 3 .
1204.It Li kern.sched.pri_max ( dynamic )
1205Maximal POSIX real-time priority.
1206See
1207.Xr sched 3 .
1208.El
1209.It Li kern.somaxkva ( Dv KERN_SOMAXKVA )
1210Maximum amount of kernel memory to be used for socket buffers in bytes.
1211.It Li kern.sooptions
1212Set the default socket option flags for
1213.Xr socket 2
1214creation.
1215See
1216.Xr setsockopt 2
1217for a list of supported flags.
1218.It Li kern.synchronized_io ( Dv KERN_SYNCHRONIZED_IO )
1219Returns 1 if the
1220.St -p1003.1b-93
1221Synchronized I/O Option is available on this system,
1222otherwise\ 0.
1223.It Li kern.timecounter ( dynamic )
1224Display and control the timecounter source of the system.
1225.Bl -column "kern.timecounter.timestepwarnings" "integer" "Changeable" -offset indent
1226.It Sy Third level name Ta Sy Type Ta Sy Changeable
1227.It kern.timecounter.choice	string	no
1228.It kern.timecounter.hardware	string	yes
1229.It kern.timecounter.timestepwarnings	integer	yes
1230.El
1231.Pp
1232The variables are as follows:
1233.Bl -tag -width "123456"
1234.It Li kern.timecounter.choice ( dynamic )
1235The list of available timecounters with their quality and frequency.
1236.It Li kern.timecounter.hardware ( dynamic )
1237The currently selected timecounter source.
1238.It Li kern.timecounter.timestepwarnings ( dynamic )
1239If non-zero display a message each time the time is stepped.
1240.El
1241.It Li kern.timex ( Dv KERN_TIMEX )
1242Not available.
1243.It Li kern.tkstat ( Dv KERN_TKSTAT )
1244Return information about the number of characters sent and received
1245on ttys.
1246The third level names for the tty statistic variables are detailed below.
1247The changeable column shows whether a process
1248with appropriate privilege may change the value.
1249.Bl -column "kern.tkstat.cancc" "quad" "Changeable" -offset indent
1250.It Sy Third level name Ta Sy Type Ta Sy Changeable
1251.It kern.tkstat.cancc	quad	no
1252.It kern.tkstat.nin	quad	no
1253.It kern.tkstat.nout	quad	no
1254.It kern.tkstat.rawcc	quad	no
1255.El
1256.Pp
1257The variables are as follows:
1258.Bl -tag -width "123456"
1259.It Li kern.tkstat.cancc ( Dv KERN_TKSTAT_CANCC )
1260The number of canonical input characters.
1261.It Li kern.tkstat.nin ( Dv KERN_TKSTAT_NIN )
1262The total number of input characters.
1263.It Li kern.tkstat.nout ( Dv KERN_TKSTAT_NOUT )
1264The total number of output characters.
1265.It Li kern.tkstat.rawcc ( Dv KERN_TKSTAT_RAWCC )
1266The number of raw input characters.
1267.El
1268.It Li kern.tty
1269The third level names for the tty setup variables are detailed below.
1270The changeable column shows whether a process
1271with appropriate privilege may change the value.
1272.Bl -column "kern.tty.qsize" "int" "Changeable" -offset indent
1273.It Sy Third level name Ta Sy Type Ta Sy Changeable
1274.It kern.tty.qsize	int	yes
1275.El
1276.Pp
1277The variables are as follows:
1278.Bl -tag -width "123456"
1279.It Li kern.tty.qsize
1280Control/display the size of the default input and output queues selected
1281during tty creation.
1282Is converted to a power of two and its range is between
1283.Dv 1024
1284and
1285.Dv 65536 .
1286.El
1287.It Li kern.uidinfo
1288Resource usage for the current user.
1289.Bl -column "kern.uidinfo.proccnt" "integer" "Changeable" -offset indent
1290.It Sy Third level name Ta Sy Type Ta Sy Changeable
1291.It kern.uidinfo.proccnt	integer	no
1292.It kern.uidinfo.lwpcnt	integer	no
1293.It kern.uidinfo.lockcnt	integer	no
1294.It kern.uidinfo.semcnt	integer	no
1295.It kern.uidinfo.sbsize	integer	no
1296.El
1297.Bl -tag -width "123456"
1298.It Li kern.uidinfo.proccnt
1299Returns the number of active processes for the current user.
1300.It Li kern.uidinfo.lwpcnt
1301Returns the number of active threads for the current user; the first thread
1302of each process is not counted.
1303.It Li kern.uidinfo.lockcnt
1304Number of locks held by the current user.
1305.It Li kern.uidinfo.semcnt
1306Number of semaphores held by the current user.
1307.It Li kern.uidinfo.sbsize
1308Number of bytes in socket buffers allocated to the current user.
1309.El
1310.It Li kern.urandom ( Dv KERN_URND )
1311Random integer value.
1312.It Li kern.usercrypto
1313When enabled, allows userland to
1314.Xr open 2
1315the
1316.Pa /dev/crypto
1317special device, used by the
1318.Xr crypto 4
1319system.
1320.It Li kern.userasymcrypto
1321Enables or disables the use of software asymmetric crypto support in the
1322.Xr crypto 4
1323system.
1324.It Li kern.veriexec
1325Runtime information for
1326.Xr veriexec 8 .
1327.Bl -column "kern.veriexec.algorithms" "integer" "Changeable" -offset indent
1328.It Sy Third level name Ta Sy Type Ta Sy Changeable
1329.It kern.veriexec.algorithms	string	no
1330.It kern.veriexec.count	node	not applicable
1331.It kern.veriexec.strict	integer	yes
1332.It kern.veriexec.verbose	integer	yes
1333.El
1334.Bl -tag -width "123456"
1335.It Li kern.veriexec.algorithms
1336Returns a string with the supported algorithms in Veriexec.
1337.It Li kern.veriexec.count
1338Sub-nodes are added to this node as new mounts are monitored by Veriexec.
1339Each mount will be under its own
1340.No tableN
1341node.
1342Under each node there will be three variables, indicating the mount
1343point, the file system type, and the number of entries.
1344.It Li kern.veriexec.strict
1345Controls the strict level of Veriexec.
1346See
1347.Xr security 7
1348for more information on each level's implications.
1349.It Li kern.veriexec.verbose
1350Controls the verbosity level of Veriexec.
1351If 0, only the minimal
1352indication required will be given about what's happening - fingerprint
1353mismatches, removal of entries from the tables, modification of a
1354fingerprinted file.
1355If 1, more messages will be printed (ie., when a file with a valid
1356fingerprint is accessed).
1357Verbose level 2 is debug mode.
1358.El
1359.It Li kern.version ( Dv KERN_VERSION )
1360The system version string.
1361.It Li kern.vnode ( Dv KERN_VNODE )
1362Return the entire vnode table.
1363Note, the vnode table is not necessarily a consistent snapshot of
1364the system.
1365The returned data consists of an array whose size depends on the
1366current number of such objects in the system.
1367Each element of the array contains the kernel address of a vnode
1368.Vt struct vnode *
1369followed by the vnode itself
1370.Vt struct vnode .
1371.El
1372.Ss The machdep.* subtree
1373The set of variables defined is architecture dependent.
1374Most architectures define at least the following variables.
1375.Bl -column "machdep.booted_kernel" "Type" "Changeable" -offset indent
1376.It Sy Second level name Ta Sy Type Ta Sy Changeable
1377.It Li machdep.booted_kernel	string	no
1378.El
1379.\" XXX: Document the above.
1380.Ss The net.* subtree
1381The string and integer information available for the
1382.Li net
1383level is detailed below.
1384The changeable column shows whether a process with appropriate
1385privilege may change the value.
1386The second and third levels are typically the protocol family and
1387protocol number, though this is not always the case.
1388.Bl -column "Second level name" "IPsec key management values" "Changeable" -offset indent
1389.It Sy Second level name Ta Sy Type Ta Sy Changeable
1390.It net.route	routing messages	no
1391.It net.inet	IPv4 values	yes
1392.It net.inet6	IPv6 values	yes
1393.It net.key	IPsec key management values	yes
1394.El
1395.Bl -tag -width "123456"
1396.It Li net.route ( Dv PF_ROUTE )
1397.\" XXX really?
1398Return the entire routing table or a subset of it.
1399The data is returned as a sequence of routing messages (see
1400.Xr route 4
1401for the header file, format and meaning).
1402The length of each message is contained in the message header.
1403.Pp
1404The third level name is a protocol number, which is currently always\ 0.
1405The fourth level name is an address family, which may be set to 0 to
1406select all address families.
1407The fifth and sixth level names are as follows:
1408.Bl -column "Fifth level name" "Sixth level is:" -offset indent
1409.It Sy Fifth level name Ta Sy Sixth level is :
1410.It NET_RT_FLAGS	rtflags
1411.It NET_RT_DUMP	None
1412.It NET_RT_IFLIST	None
1413.El
1414.It Li net.inet ( Dv PF_INET )
1415Get or set various global information about the IPv4
1416.Pq Internet Protocol version 4 .
1417The third level name is the protocol.
1418The fourth level name is the variable name.
1419The currently defined protocols and names are:
1420.Bl -column "Protocol" "anonportalgo.available" "integer" "Changeable" -offset indent
1421.It Sy Protocol	Variable Ta Sy Type Ta Sy Changeable
1422.It arp	down	integer	yes
1423.It arp	keep	integer	yes
1424.It arp	log_movements	integer	yes
1425.It arp	log_permanent_modify	integer	yes
1426.It arp	log_unknown_network	integer	yes
1427.It arp	log_wrong_iface	integer	yes
1428.It carp	allow	integer	yes
1429.It carp	preempt	integer	yes
1430.It carp	log	integer	yes
1431.It carp	arpbalance	integer	yes
1432.It icmp	errppslimit	integer	yes
1433.It icmp	maskrepl	integer	yes
1434.It icmp	rediraccept	integer	yes
1435.It icmp	redirtimeout	integer	yes
1436.It icmp	bmcastecho	integer	yes
1437.It ip	allowsrcrt	integer	yes
1438.It ip 	anonportalgo.selected	string	yes
1439.It ip 	anonportalgo.available	string	yes
1440.It ip 	anonportalgo.reserve	struct	yes
1441.It ip	anonportmax	integer	yes
1442.It ip	anonportmin	integer	yes
1443.It ip	checkinterface	integer	yes
1444.It ip	dad_count	integer	yes
1445.It ip	directed-broadcast	integer	yes
1446.It ip	do_loopback_cksum	integer	yes
1447.It ip	forwarding	integer	yes
1448.It ip	forwsrcrt	integer	yes
1449.It ip	gifttl	integer	yes
1450.It ip	grettl	integer	yes
1451.It ip	hashsize	integer	yes
1452.It ip	hostzerobroadcast	integer	yes
1453.It ip	lowportmin	integer	yes
1454.It ip	lowportmax	integer	yes
1455.It ip	maxflows	integer	yes
1456.It ip	maxfragpackets	integer	yes
1457.It ip	mtudisc	integer	yes
1458.It ip	mtudisctimeout	integer	yes
1459.It ip	random_id	integer	yes
1460.It ip	redirect	integer	yes
1461.It ip	subnetsarelocal	integer	yes
1462.It ip	ttl	integer	yes
1463.It tcp	rfc1323	integer	yes
1464.It tcp	sendspace	integer	yes
1465.It tcp	recvspace	integer	yes
1466.It tcp	mssdflt	integer	yes
1467.It tcp	syn_cache_limit	integer	yes
1468.It tcp	syn_bucket_limit	integer	yes
1469.It tcp	syn_cache_interval	integer	yes
1470.It tcp	init_win	integer	yes
1471.It tcp	init_win_local	integer	yes
1472.It tcp	mss_ifmtu	integer	yes
1473.It tcp	win_scale	integer	yes
1474.It tcp	timestamps	integer	yes
1475.It tcp	cwm	integer	yes
1476.It tcp	cwm_burstsize	integer	yes
1477.It tcp	ack_on_push	integer	yes
1478.It tcp	keepidle	integer	yes
1479.It tcp	keepintvl	integer	yes
1480.It tcp	keepcnt	integer	yes
1481.It tcp	slowhz	integer	no
1482.It tcp	keepinit	integer	yes
1483.It tcp	log_refused	integer	yes
1484.It tcp	rstppslimit	integer	yes
1485.It tcp	ident	struct	no
1486.It tcp	drop	struct	no
1487.It tcp	sack.enable	integer	yes
1488.It tcp	sack.globalholes	integer	no
1489.It tcp	sack.globalmaxholes	integer	yes
1490.It tcp	sack.maxholes	integer	yes
1491.It tcp	ecn.enable	integer	yes
1492.It tcp	ecn.maxretries	integer	yes
1493.It tcp	congctl.selected	string	yes
1494.It tcp	congctl.available	string	yes
1495.It tcp	abc.enable	integer	yes
1496.It tcp	abc.aggressive	integer	yes
1497.It udp	checksum	integer	yes
1498.It udp	do_loopback_cksum	integer	yes
1499.It udp	recvspace	integer	yes
1500.It udp	sendspace	integer	yes
1501.El
1502.Pp
1503The variables are as follows:
1504.Bl -tag -width "123456"
1505.It Li arp.down
1506Failed ARP entry lifetime.
1507.It Li arp.keep
1508Valid ARP entry lifetime.
1509.It Li carp.allow
1510If set to 0, incoming
1511.Xr carp 4
1512packets will not be processed.
1513If set to any other value, processing will occur.
1514Enabled by default.
1515.It Li carp.arpbalance
1516If set to any value other than 0, the ARP balancing functionality of
1517.Xr carp 4
1518is enabled.
1519When ARP requests are received for an IP address which is part of any virtual
1520host, carp will hash the source IP in the ARP request to select one of the
1521virtual hosts from the set of all the virtual hosts which have that IP address.
1522The master of that host will respond with the correct virtual MAC address.
1523Disabled by default.
1524.It Li carp.log
1525If set to any value other than 0,
1526.Xr carp 4
1527will log errors.
1528Disabled by default.
1529.It Li carp.preempt
1530If set to 0,
1531.Xr carp 4
1532will not attempt to become master if it is receiving advertisements from
1533another active master.
1534If set to any other value, carp will become master of the virtual host if it
1535believes it can send advertisements more frequently than the current master.
1536Disabled by default.
1537.It Li ip.allowsrcrt
1538If set to 1, the host accepts source routed packets.
1539.It Li ip.anonportalgo.available
1540The available RFC 6056 port randomization algorithms.
1541.It Li ip.anonportalgo.reserve
1542A bitmask of ports that will not be used during anonymous or privileged
1543port selection.
1544.It Li ip.anonportalgo.selected
1545The currently selected RFC 6056 port randomization algorithm; see
1546.Xr rfc6056 7
1547for details.
1548.It Li ip.anonportmax
1549The highest port number to use for TCP and UDP ephemeral port allocation.
1550This cannot be set to less than 1024 or greater than 65535, and must
1551be greater than
1552.Li ip.anonportmin .
1553.It Li ip.anonportmin
1554The lowest port number to use for TCP and UDP ephemeral port allocation.
1555This cannot be set to less than 1024 or greater than 65535.
1556.It Li ip.checkinterface
1557If set to non-zero, the host will reject packets addressed to it
1558that arrive on an interface not bound to that address.
1559Currently, this must be disabled if NAT is used to translate the
1560destination address to another local interface, or if addresses
1561are added to the loopback interface instead of the interface where
1562the packets for those packets are received.
1563.It Li ip.dad_count
1564The number of
1565.Xr arp 4
1566probes sent for Address Conflict Detection.
1567Set to 0 to disable this.
1568.It Li ip.directed-broadcast
1569If set to 1, enables directed broadcast behavior for the host.
1570.It Li ip.do_loopback_cksum
1571Perform IP checksum on loopback.
1572.It Li ip.forwarding
1573If set to 1, enables IP forwarding for the host,
1574meaning that the host is acting as a router.
1575.It Li ip.forwsrcrt
1576If set to 1, enables forwarding of source-routed packets for the host.
1577This value may only be changed if the kernel security level is less than 1.
1578.It Li ip.gifttl
1579The maximum time-to-live (hop count) value for an IPv4 packet generated by
1580.Xr gif 4
1581tunnel interface.
1582.It Li ip.grettl
1583The maximum time-to-live (hop count) value for an IPv4 packet generated by
1584.Xr gre 4
1585tunnel interface.
1586.It Li ip.hashsize
1587The size of IPv4 Fast Forward hash table.
1588This value must be a power of 2 (64, 256...).
1589A larger hash table size results in fewer collisions.
1590Also see
1591.Li ip.maxflows .
1592.It Li ip.hostzerobroadcast
1593All zeroes address is broadcast address.
1594.It Li ip.lowportmax
1595The highest port number to use for TCP and UDP reserved port allocation.
1596This cannot be set to less than 0 or greater than 1024, and must
1597be greater than
1598.Li ip.lowportmin .
1599.It Li ip.lowportmin
1600The lowest port number to use for TCP and UDP reserved port allocation.
1601This cannot be set to less than 0 or greater than 1024, and must
1602be smaller than
1603.Li ip.lowportmax .
1604.It Li ip.maxflows
1605IPv4 Fast Forwarding is enabled by default.
1606If set to 0, IPv4 Fast Forwarding is disabled.
1607.Li ip.maxflows
1608controls the maximum amount of flows which can be created.
1609The default value is 256.
1610.It Li ip.maxfragpackets
1611The maximum number of fragmented packets the node will accept.
16120 means that the node will not accept any fragmented packets.
1613\-1 means that the node will accept as many fragmented packets as it receives.
1614The flag is provided basically for avoiding possible DoS attacks.
1615.It Li ip.mtudisc
1616If set to 1, enables Path MTU Discovery (RFC 1191).
1617When Path MTU Discovery is enabled, the transmitted TCP segment
1618size will be determined by the advertised maximum segment size
1619(MSS) from the remote end, as constrained by the path MTU.
1620If MTU Discovery is disabled, the transmitted segment size will
1621never be greater than
1622.Li tcp.mssdflt
1623(the local maximum segment size).
1624.It Li ip.mtudisctimeout
1625The number of seconds in which a route added by the Path MTU
1626Discovery engine will time out.
1627When the route times out, the Path
1628MTU Discovery engine will attempt to probe a larger path MTU.
1629.It Li ip.random_id
1630Assign random ip_id values.
1631.It Li ip.redirect
1632If set to 1, ICMP redirects may be sent by the host.
1633This option is ignored unless the host is routing IP packets,
1634and should normally be enabled on all systems.
1635.It Li ip.subnetsarelocal
1636If set to 1, subnets are to be considered local addresses.
1637.It Li ip.ttl
1638The maximum time-to-live (hop count) value for an IP packet sourced by
1639the system.
1640This value applies to normal transport protocols, not to ICMP.
1641.It Li icmp.errppslimit
1642The variable specifies the maximum number of outgoing ICMP error messages,
1643per second.
1644ICMP error messages that exceeded the value are subject to rate limitation
1645and will not go out from the node.
1646Negative value disables rate limitation.
1647.It Li icmp.maskrepl
1648If set to 1, ICMP network mask requests are to be answered.
1649.It Li icmp.rediraccept
1650If set to non-zero, the host will accept ICMP redirect packets.
1651Note that routers will never accept ICMP redirect packets,
1652and the variable is meaningful on IP hosts only.
1653.It Li icmp.redirtimeout
1654The variable specifies lifetime of routing entries generated by incoming
1655ICMP redirect.
1656This defaults to 600 seconds.
1657.It Li icmp.returndatabytes
1658Number of bytes to return in an ICMP error message.
1659.It Li icmp.bmcastecho
1660If set to 1, enables responding to ICMP echo or timestamp request to the
1661broadcast address.
1662.It Li tcp.ack_on_push
1663If set to 1, TCP is to immediately transmit an ACK upon reception of
1664a packet with PUSH set.
1665This can avoid losing a round trip time in some rare situations,
1666but has the caveat of potentially defeating TCP's delayed ACK algorithm.
1667Use of this option is generally not recommended, but
1668the variable exists in case your configuration really needs it.
1669.It Li tcp.cwm
1670If set to 1, enables use of the Hughes/Touch/Heidemann Congestion Window
1671Monitoring algorithm.
1672This algorithm prevents line-rate bursts of packets that could
1673otherwise occur when data begins flowing on an idle TCP connection.
1674These line-rate bursts can contribute to network and router congestion.
1675This can be particularly useful on World Wide Web servers
1676which support HTTP/1.1, which has lingering connections.
1677.It Li tcp.cwm_burstsize
1678The Congestion Window Monitoring allowed burst size, in terms
1679of packet count.
1680.It Li tcp.delack_ticks
1681Number of ticks to delay sending an ACK.
1682.It Li tcp.do_loopback_cksum
1683Perform TCP checksum on loopback.
1684.It Li tcp.init_win
1685A value indicating the TCP initial congestion window.
1686The valid range
1687is 0 to 10 (maximum specified by RFC6928),
1688with a default of 4 (approximately 4K per RFC3390).
1689.It Li tcp.init_win_local
1690Like
1691.Li tcp.init_win ,
1692but used when communicating with hosts on a local network.
1693.It Li tcp.keepcnt
1694Number of keepalive probes sent before declaring a connection dead.
1695If set to zero, there is no limit;
1696keepalives will be sent until some kind of
1697response is received from the peer.
1698.It Li tcp.keepidle
1699Time a connection must be idle before keepalives are sent (if keepalives
1700are enabled for the connection).
1701See also tcp.slowhz.
1702.It Li tcp.keepintvl
1703Time after a keepalive probe is sent until, in the absence of any response,
1704another probe is sent.
1705See also tcp.slowhz.
1706.It Li tcp.log_refused
1707If set to 1, refused TCP connections to the host will be logged.
1708.It Li tcp.keepinit
1709Timeout in seconds during connection establishment.
1710.It Li tcp.mss_ifmtu
1711If set to 1, TCP calculates the outgoing maximum segment size based on
1712the MTU of the appropriate interface.
1713If set to 0, it is calculated based on the greater of the MTU of the
1714interface, and the largest (non-loopback) interface MTU on the system.
1715.It Li tcp.mssdflt
1716The default maximum segment size both advertised to the peer
1717and to use when either the peer does not advertise a maximum segment size to
1718us during connection setup or Path MTU Discovery
1719.Li ( ip.mtudisc )
1720is disabled.
1721Do not change this value unless you really know what you are doing.
1722.It Li tcp.recvspace
1723The default TCP receive buffer size.
1724.It Li tcp.rfc1323
1725If set to 1, enables RFC 1323 extensions to TCP.
1726.It Li tcp.rstppslimit
1727The variable specifies the maximum number of outgoing TCP RST packets,
1728per second.
1729TCP RST packet that exceeded the value are subject to rate limitation
1730and will not go out from the node.
1731Negative value disables rate limitation.
1732.It Li tcp.ident
1733Return the user ID of a connected socket pair.
1734(RFC1413 Identification Protocol lookups.)
1735.It Li tcp.drop
1736Drop a TCP socket pair connection.
1737.It Li tcp.sack.enable
1738If set to 1, enables RFC 2018 Selective ACKnowledgement.
1739.It Li tcp.sack.globalholes
1740Global number of TCP SACK holes.
1741.It Li tcp.sack.globalmaxholes
1742Global maximum number of TCP SACK holes.
1743.It Li tcp.sack.maxholes
1744Maximum number of TCP SACK holes allowed per connection.
1745.It Li tcp.ecn.enable
1746If set to 1, enables RFC 3168 Explicit Congestion Notification.
1747.It Li tcp.ecn.maxretries
1748Number of times to retry sending the ECN-setup packet.
1749.It Li tcp.sendspace
1750The default TCP send buffer size.
1751.It Li tcp.slowhz
1752The units for tcp.keepidle and tcp.keepintvl; those variables are in ticks
1753of a clock that ticks tcp.slowhz times per second.
1754(That is, their values
1755must be divided by the tcp.slowhz value to get times in seconds.)
1756.It Li tcp.syn_bucket_limit
1757The maximum number of entries allowed per hash bucket in the TCP
1758compressed state engine.
1759.It Li tcp.syn_cache_limit
1760The maximum number of entries allowed in the TCP compressed state
1761engine.
1762.It Li tcp.timestamps
1763If rfc1323 is enabled, a value of 1 indicates RFC 1323 time stamp options,
1764used for measuring TCP round trip times, are enabled.
1765.It Li tcp.win_scale
1766If rfc1323 is enabled, a value of 1 indicates RFC 1323 window scale options,
1767for increasing the TCP window size, are enabled.
1768.It Li tcp.congctl.available
1769The available TCP congestion control algorithms.
1770.It Li tcp.congctl.selected
1771The currently selected TCP congestion control algorithm.
1772.It Li tcp.abc.enable
1773If set to 1, use RFC 3465 Appropriate Byte Counting (ABC).
1774If set to 0, use traditional Packet Counting.
1775.It Li tcp.abc.aggressive
1776Choose the L parameter found in RFC 3465.
1777L is the maximum cwnd increase for an ack during slow start.
1778If set to 1, use L=2*SMSS.
1779If set to 0, use L=1*SMSS.
1780It has no effect unless tcp.abc.enable is set to 1.
1781.It Li udp.checksum
1782If set to 1, UDP checksums are being computed.
1783Received non-zero UDP checksums are always checked.
1784Disabling UDP checksums is strongly discouraged.
1785.It Li udp.recvspace
1786The default UDP receive buffer size.
1787.It Li udp.sendspace
1788The default UDP send buffer size.
1789.El
1790.Pp
1791For variables net.*.ipsec, please refer to
1792.Xr ipsec 4 .
1793.It Li net.inet6 ( Dv PF_INET6 )
1794Get or set various global information about the IPv6
1795.Pq Internet Protocol version 6 .
1796The third level name is the protocol.
1797The fourth level name is the variable name.
1798The currently defined protocols and names are:
1799.Bl -column "Protocol" "anonportalgo.available" "integer" "Changeable" -offset indent
1800.It Sy Protocol	Variable Ta Sy Type Ta Sy Changeable
1801.It icmp6	errppslimit	integer	yes
1802.It icmp6	mtudisc_hiwat	integer	yes
1803.It icmp6	mtudisc_lowat	integer	yes
1804.It icmp6	nd6_debug	integer	yes
1805.It icmp6	nd6_delay	integer	yes
1806.It icmp6	nd6_maxnudhint	integer	yes
1807.It icmp6	nd6_mmaxtries	integer	yes
1808.It icmp6	nd6_prune	integer	yes
1809.It icmp6	nd6_umaxtries	integer	yes
1810.It icmp6	nd6_useloopback	integer	yes
1811.It icmp6	nodeinfo	integer	yes
1812.It icmp6	rediraccept	integer	yes
1813.It icmp6	redirtimeout	integer	yes
1814.It ip6	accept_rtadv	integer	yes
1815.It ip6	addctlpolicy	struct in6_addrpolicy	no
1816.It ip6	anonportalgo.selected	string	yes
1817.It ip6	anonportalgo.available	string	yes
1818.It ip6	anonportalgo.reserve	struct	yes
1819.It ip6	anonportmax	integer	yes
1820.It ip6	anonportmin	integer	yes
1821.It ip6	auto_flowlabel	integer	yes
1822.It ip6	dad_count	integer	yes
1823.It ip6	defmcasthlim	integer	yes
1824.It ip6	forwarding	integer	yes
1825.It ip6	gifhlim	integer	yes
1826.It ip6	hashsize	integer	yes
1827.It ip6	hlim	integer	yes
1828.It ip6	hdrnestlimit	integer	yes
1829.It ip6	kame_version	string	no
1830.It ip6	keepfaith	integer	yes
1831.It ip6	log_interval	integer	yes
1832.It ip6	lowportmax	integer	yes
1833.It ip6	lowportmin	integer	yes
1834.It ip6	maxdynroutes	integer	yes
1835.It ip6	maxifprefixes	integer	yes
1836.It ip6	maxifdefrouters	integer	yes
1837.It ip6	maxflows	integer	yes
1838.It ip6	maxfragpackets	integer	yes
1839.It ip6	maxfrags	integer	yes
1840.It ip6	neighborgcthresh	integer	yes
1841.It ip6	redirect	integer	yes
1842.It ip6	rr_prune	integer	yes
1843.It ip6	use_deprecated	integer	yes
1844.It ip6	v6only	integer	yes
1845.It udp6	do_loopback_cksum	integer	yes
1846.It udp6	recvspace	integer	yes
1847.It udp6	sendspace	integer	yes
1848.El
1849.Pp
1850The variables are as follows:
1851.Bl -tag -width "123456"
1852.It Li ip6.accept_rtadv
1853If set to non-zero, the node will accept ICMPv6 router advertisement packets
1854and autoconfigures address prefixes and default routers.
1855The node must be a host
1856.Pq not a router
1857for the option to be meaningful.
1858.It Li ip6.anonportalgo.available
1859The available RFC 6056 port randomization algorithms.
1860.It Li ip6.anonportalgo.reserve
1861A bitmask of ports that will not be used during anonymous or privileged
1862port selection.
1863.It Li ip6.anonportalgo.selected
1864The currently selected RFC 6056 port randomization algorithm; see
1865.Xr rfc6056 7
1866for details.
1867.It Li ip6.anonportmax
1868The highest port number to use for TCP and UDP ephemeral port allocation.
1869This cannot be set to less than 1024 or greater than 65535, and must
1870be greater than
1871.Li ip6.anonportmin .
1872.It Li ip6.anonportmin
1873The lowest port number to use for TCP and UDP ephemeral port allocation.
1874This cannot be set to less than 1024 or greater than 65535.
1875.It Li ip6.auto_flowlabel
1876On connected transport protocol packets,
1877fill IPv6 flowlabel field to help intermediate routers to identify packet flows.
1878.It Li ip6.dad_count
1879The variable configures number of IPv6 DAD
1880.Pq duplicated address detection
1881probe packets.
1882The packets will be generated when IPv6 interface addresses are configured.
1883.It Li ip6.defmcasthlim
1884The default hop limit value for an IPv6 multicast packet sourced by the node.
1885This value applies to all the transport protocols on top of IPv6.
1886There are APIs to override the value, as documented in
1887.Xr ip6 4 .
1888.It Li ip6.forwarding
1889If set to 1, enables IPv6 forwarding for the node,
1890meaning that the node is acting as a router.
1891If set to 0, disables IPv6 forwarding for the node,
1892meaning that the node is acting as a host.
1893IPv6 specification defines node behavior for
1894.Dq router
1895case and
1896.Dq host
1897case quite differently, and changing this variable during operation
1898may cause serious trouble.
1899It is recommended to configure the variable at bootstrap time,
1900and bootstrap time only.
1901.It Li ip6.gifhlim
1902The maximum hop limit value for an IPv6 packet generated by
1903.Xr gif 4
1904tunnel interface.
1905.It Li ip6.hdrnestlimit
1906The number of IPv6 extension headers permitted on incoming IPv6 packets.
1907If set to 0, the node will accept as many extension headers as possible.
1908.It Li ip6.hashsize
1909The size of IPv6 Fast Forward hash table.
1910This value must be a power of 2 (64, 256, ...).
1911A larger hash table size results in fewer collisions.
1912Also see
1913.Li ip6.maxflows .
1914.It Li ip6.hlim
1915The default hop limit value for an IPv6 unicast packet sourced by the node.
1916This value applies to all the transport protocols on top of IPv6.
1917There are APIs to override the value, as documented in
1918.Xr ip6 4 .
1919.It Li ip6.kame_version
1920The string identifies the version of KAME IPv6 stack implemented in the kernel.
1921.It Li ip6.keepfaith
1922If set to non-zero, it enables
1923.Dq FAITH
1924TCP relay IPv6-to-IPv4 translator code in the kernel.
1925Refer
1926.Xr faith 4
1927and
1928.Xr faithd 8
1929for detail.
1930.It Li ip6.log_interval
1931The variable controls amount of logs generated by IPv6 packet
1932forwarding engine, by setting interval between log output
1933.Pq in seconds .
1934.It Li ip6.lowportmax
1935The highest port number to use for TCP and UDP reserved port allocation.
1936This cannot be set to less than 0 or greater than 1024, and must
1937be greater than
1938.Li ip6.lowportmin .
1939.It Li ip6.lowportmin
1940The lowest port number to use for TCP and UDP reserved port allocation.
1941This cannot be set to less than 0 or greater than 1024, and must
1942be smaller than
1943.Li ip6.lowportmax .
1944.It Li ip6.maxdynroutes
1945Maximum number of routes created by redirect.
1946Set it to negative to disable.
1947The default value is 4096.
1948.It Li ip6.maxifprefixes
1949Maximum number of prefixes created by route advertisements per interface.
1950Set it to negative to disable.
1951The default value is 16.
1952.It Li ip6.maxifdefrouters 16
1953Maximum number of default routers created by route advertisements per interface.
1954Set it to negative to disable.
1955The default value is 16.
1956.It Li ip6.maxflows
1957IPv6 Fast Forwarding is enabled by default.
1958If set to 0, IPv6 Fast Forwarding is disabled.
1959.Li ip6.maxflows
1960controls the maximum amount of flows which can be created.
1961The default value is 256.
1962.It Li ip6.maxfragpackets
1963The maximum number of fragmented packets the node will accept.
19640 means that the node will not accept any fragmented packets.
1965\-1 means that the node will accept as many fragmented packets as it receives.
1966The flag is provided basically for avoiding possible DoS attacks.
1967.It Li ip6.maxfrags
1968The maximum number of fragments the node will accept.
19690 means that the node will not accept any fragments.
1970\-1 means that the node will accept as many fragments as it receives.
1971The flag is provided basically for avoiding possible DoS attacks.
1972.It Li ip6.neighborgcthresh
1973Maximum number of entries in neighbor cache per interface.
1974Set to negative to disable.
1975The default value is 2048.
1976.It Li ip6.redirect
1977If set to 1, ICMPv6 redirects may be sent by the node.
1978This option is ignored unless the node is routing IP packets,
1979and should normally be enabled on all systems.
1980.It Li ip6.rr_prune
1981The variable specifies interval between IPv6 router renumbering prefix
1982babysitting, in seconds.
1983.It Li ip6.use_deprecated
1984The variable controls use of deprecated address, specified in RFC 2462 5.5.4.
1985.It Li ip6.v6only
1986The variable specifies initial value for
1987.Dv IPV6_V6ONLY
1988socket option for
1989.Dv AF_INET6
1990socket.
1991Please refer to
1992.Xr ip6 4
1993for detail.
1994.It Li icmp6.errppslimit
1995The variable specifies the maximum number of outgoing ICMPv6 error messages,
1996per second.
1997ICMPv6 error messages that exceeded the value are subject to rate limitation
1998and will not go out from the node.
1999Negative value disables rate limitation.
2000.It Li icmp6.mtudisc_hiwat
2001.It Li icmp6.mtudisc_lowat
2002The variables define the maximum number of routing table entries,
2003created due to path MTU discovery
2004.Pq prevents denial-of-service attacks with ICMPv6 too big messages .
2005When IPv6 path MTU discovery happens, we keep path MTU information into
2006the routing table.
2007If the number of routing table entries exceed the value,
2008the kernel will not attempt to keep the path MTU information.
2009.Li icmp6.mtudisc_hiwat
2010is used when we have verified ICMPv6 too big messages.
2011.Li icmp6.mtudisc_lowat
2012is used when we have unverified ICMPv6 too big messages.
2013Verification is performed by using address/port pairs kept in connected pcbs.
2014Negative value disables the upper limit.
2015.It Li icmp6.nd6_debug
2016If set to non-zero, kernel IPv6 neighbor discovery code will generate
2017debugging messages.
2018The debug outputs are useful to diagnose IPv6 interoperability issues.
2019The flag must be set to 0 for normal operation.
2020.It Li icmp6.nd6_delay
2021The variable specifies
2022.Dv DELAY_FIRST_PROBE_TIME
2023timing constant in IPv6 neighbor discovery specification
2024.Pq RFC 2461 ,
2025in seconds.
2026.It Li icmp6.nd6_maxnudhint
2027IPv6 neighbor discovery permits upper layer protocols to supply reachability
2028hints, to avoid unnecessary neighbor discovery exchanges.
2029The variable defines the number of consecutive hints the neighbor discovery
2030layer will take.
2031For example, by setting the variable to 3, neighbor discovery layer
2032will take 3 consecutive hints in maximum.
2033After receiving 3 hints, neighbor discovery layer will perform
2034normal neighbor discovery process.
2035.It Li icmp6.nd6_mmaxtries
2036The variable specifies
2037.Dv MAX_MULTICAST_SOLICIT
2038constant in IPv6 neighbor discovery specification
2039.Pq RFC 2461 .
2040.It Li icmp6.nd6_prune
2041The variable specifies interval between IPv6 neighbor cache babysitting,
2042in seconds.
2043.It Li icmp6.nd6_umaxtries
2044The variable specifies
2045.Dv MAX_UNICAST_SOLICIT
2046constant in IPv6 neighbor discovery specification
2047.Pq RFC 2461 .
2048.It Li icmp6.nd6_useloopback
2049If set to non-zero, kernel IPv6 stack will use loopback interface for
2050local traffic.
2051.It Li icmp6.nodeinfo
2052The variable enables responses to ICMPv6 node information queries.
2053If you set the variable to 0, responses will not be generated for
2054ICMPv6 node information queries.
2055Since node information queries can have a security impact, it is
2056possible to fine tune which responses should be answered.
2057Two separate bits can be set.
2058.Bl -tag -width "12345"
2059.It 1
2060Respond to ICMPv6 FQDN queries, e.g.
2061.Li ping6 -w .
2062.It 2
2063Respond to ICMPv6 node addresses queries, e.g.
2064.Li ping6 -a .
2065.El
2066.It Li icmp6.rediraccept
2067If set to non-zero, the host will accept ICMPv6 redirect packets.
2068Note that IPv6 routers will never accept ICMPv6 redirect packets,
2069and the variable is meaningful on IPv6 hosts
2070.Pq non-router
2071only.
2072.It Li icmp6.redirtimeout
2073The variable specifies lifetime of routing entries generated by incoming
2074ICMPv6 redirect.
2075.It Li udp6.do_loopback_cksum
2076Perform UDP checksum on loopback.
2077.It Li udp6.recvspace
2078Default UDP receive buffer size.
2079.It Li udp6.sendspace
2080Default UDP send buffer size.
2081.El
2082.Pp
2083We reuse net.*.tcp for TCP over IPv6,
2084and therefore we do not have variables net.*.tcp6.
2085Variables net.inet6.udp6 have identical meaning to net.inet.udp.
2086Please refer to
2087.Li PF_INET
2088section above.
2089For variables net.*.ipsec6, please refer to
2090.Xr ipsec 4 .
2091.It Li net.key ( Dv PF_KEY )
2092Get or set various global information about the IPsec key management.
2093The third level name is the variable name.
2094The currently defined variable and names are:
2095.Bl -column "blockacq_lifetime" "integer" "Changeable" -offset indent
2096.It Sy Variable	Type Ta Sy Changeable
2097.It debug	integer	yes
2098.It enabled	integer	yes
2099.It used	integer	no
2100.It spi_try	integer	yes
2101.It spi_min_value	integer	yes
2102.It spi_max_value	integer	yes
2103.It larval_lifetime	integer	yes
2104.It blockacq_count	integer	yes
2105.It blockacq_lifetime	integer	yes
2106.It esp_keymin	integer	yes
2107.It esp_auth	integer	yes
2108.It ah_keymin	integer	yes
2109.El
2110The variables are as follows:
2111.Bl -tag -width "123456"
2112.It Li debug
2113Turn on debugging message from within the kernel.
2114The value is a bitmap, as defined in
2115.In netipsec/key_debug.h .
2116.It Li enabled
2117Control processing of IPsec control messages.
2118.Bl -tag -width indent
2119.It 0
2120Never allow IPsec processing
2121.It 1
2122Allow IPsec processing when SPD policies are present.
2123.It 2
2124Force IPsec processing even when SPD policies are not present.
2125.El
2126.It Li used
2127Based on if IPsec is enabled, and SPD rule existence, show if
2128IPsec is being used.
2129Note that currently once IPsec is being used, it cannot be disabled.
2130.It Li spi_try
2131The number of times the kernel will try to obtain an unique SPI
2132when it generates it from random number generator.
2133.It Li spi_min_value
2134Minimum SPI value when generating it within the kernel.
2135.It Li spi_max_value
2136Maximum SPI value when generating it within the kernel.
2137.It Li larval_lifetime
2138Lifetime for LARVAL SAD entries, in seconds.
2139.It Li blockacq_count
2140Number of ACQUIRE PF_KEY messages to be blocked after an ACQUIRE message.
2141It avoids flood of ACQUIRE PF_KEY from being sent from the kernel to the
2142key management daemon.
2143.It Li blockacq_lifetime
2144Lifetime of ACQUIRE PF_KEY message.
2145.It Li esp_keymin
2146Minimum ESP key length, in bits.
2147The value is used when the kernel creates proposal payload
2148on ACQUIRE PF_KEY message.
2149.It Li esp_auth
2150Whether ESP authentication should be used or not.
2151Non-zero value indicates that ESP authentication should be used.
2152The value is used when the kernel creates proposal payload
2153on ACQUIRE PF_KEY message.
2154.It Li ah_keymin
2155Minimum AH key length, in bits,
2156The value is used when the kernel creates proposal payload
2157on ACQUIRE PF_KEY message.
2158.El
2159.It Li net.local ( Dv PF_LOCAL )
2160Get or set various global information about
2161.Dv AF_LOCAL
2162type sockets.
2163For some variables, the third level name is the variable name:
2164.Bl -column "Variable" "integer" "Changeable" -offset indent
2165.It Sy Variable	Type Ta Sy Changeable
2166.It inflight	integer	no
2167.It deferred	integer	no
2168.El
2169The variables are as follows:
2170.Bl -tag -width "123456"
2171.It Li inflight
2172The number of file descriptors currently passed between processes,
2173.Qq in flight .
2174.It Li deferred
2175The number of file descriptors passed between processes that have been
2176deferred for cleanup by a kernel task.
2177.El
2178.Pp
2179Other variables are specific to a socket type:
2180.Bl -column "seqpacket" "sendspace" "integer" "Changeable" -offset indent
2181.It Sy "Socket Type"  	Sy Variable	Type Ta Sy Changeable
2182.It dgram	pcblist	struct	no
2183.It dgram	recvspace	integer	yes
2184.It dgram	sendspace	integer	yes
2185.It seqpacket	pcblist	struct	no
2186.It stream	pcblist	struct	no
2187.It stream	recvspace	integer	yes
2188.It stream	sendspace	integer	yes
2189.El
2190The variables are as follows:
2191.Bl -tag -width "123456"
2192.It Li dgram.pcblist
2193The Protocol Control Block list structure for datagram sockets.
2194Parsed by
2195.Xr netstat 1
2196or
2197.Xr sockstat 1 .
2198.It Li dgram.recvspace
2199The default datagram receive buffer size.
2200.It Li dgram.sendspace
2201The default datagram send buffer size.
2202.It Li seqpacket.pcblist
2203The Protocol Control Block list structure for Sequential Packet sockets.
2204Parsed by
2205.Xr netstat 1
2206or
2207.Xr sockstat 1 .
2208.It Li stream.pcblist
2209The Protocol Control Block list structure for stream sockets.
2210Parsed by
2211.Xr netstat 1
2212or
2213.Xr sockstat 1 .
2214.It Li stream.recvspace
2215The default stream receive buffer size.
2216.It Li stream.sendspace
2217The default stream send buffer size.
2218.El
2219.El
2220.Ss The proc.* subtree
2221The string and integer information available for the
2222.Li proc
2223level is detailed below.
2224The changeable column shows whether a process with appropriate
2225privilege may change the value.
2226These values are per-process,
2227and as such may change from one process to another.
2228When a process is created,
2229the default values are inherited from its parent.
2230When a set-user-ID or set-group-ID binary is executed, the
2231value of PROC_PID_CORENAME is reset to the system default value.
2232The second level name is either the magic value PROC_CURPROC, which
2233points to the current process, or the PID of the target process.
2234.Bl -column "proc.pid.corename" "string" "not applicable" -offset indent
2235.It Sy Third level name Ta Sy Type Ta Sy Changeable
2236.It proc.pid.corename	string	yes
2237.It proc.pid.rlimit	node	not applicable
2238.It proc.pid.stopfork	int	yes
2239.It proc.pid.stopexec	int	yes
2240.It proc.pid.stopexit	int	yes
2241.It proc.pid.paxflags	int	no
2242.El
2243.Bl -tag -width "123456"
2244.It Li proc.pid.corename ( Dv PROC_PID_CORENAME )
2245The template used for the core dump file name (see
2246.Xr core 5
2247for details).
2248The base name must either be
2249.Pa core
2250or end with the suffix
2251.Pa .core
2252(the super-user may set arbitrary names).
2253By default it points to
2254.Dv KERN_DEFCORENAME .
2255.It Li proc.pid.rlimit ( Dv PROC_PID_LIMIT )
2256Return resources limits, as defined for the
2257.Xr getrlimit 2
2258and
2259.Xr setrlimit 2
2260system calls.
2261The fourth level name is one of:
2262.Bl -tag -width "123456"
2263.It Li proc.pid.rlimit.cputime ( Dv PROC_PID_LIMIT_CPU )
2264The maximum amount of CPU time (in seconds) to be used by each process.
2265.It Li proc.pid.rlimit.filesize ( Dv PROC_PID_LIMIT_FSIZE )
2266The largest size (in bytes) file that may be created.
2267.It Li proc.pid.rlimit.datasize ( Dv PROC_PID_LIMIT_DATA )
2268The maximum size (in bytes) of the data segment for a process;
2269this defines how far a program may extend its break with the
2270.Xr sbrk 2
2271system call.
2272.It Li proc.pid.rlimit.stacksize ( Dv PROC_PID_LIMIT_STACK )
2273The maximum size (in bytes) of the stack segment for a process;
2274this defines how far a program's stack segment may be extended.
2275Stack extension is performed automatically by the system.
2276.It Li proc.pid.rlimit.coredumpsize ( Dv PROC_PID_LIMIT_CORE )
2277The largest size (in bytes)
2278.Pa core
2279file that may be created.
2280.It Li proc.pid.rlimit.memoryuse ( Dv PROC_PID_LIMIT_RSS )
2281The maximum size (in bytes) to which a process's resident set size may
2282grow.
2283This imposes a limit on the amount of physical memory to be given to
2284a process; if memory is tight, the system will prefer to take memory
2285from processes that are exceeding their declared resident set size.
2286.It Li proc.pid.rlimit.memorylocked ( Dv PROC_PID_LIMIT_MEMLOCK )
2287The maximum size (in bytes) which a process may lock into memory
2288using the
2289.Xr mlock 2
2290function.
2291.It Li proc.pid.rlimit.maxproc ( Dv PROC_PID_LIMIT_NPROC )
2292The maximum number of simultaneous processes for this user id.
2293.It Li proc.pid.rlimit.descriptors ( Dv PROC_PID_LIMIT_NOFILE )
2294The maximum number of open files for this process.
2295.It Li proc.pid.rlimit.sbsize ( Dv PROC_PID_LIMIT_SBSIZE )
2296The maximum size (in bytes) of the socket buffers
2297set by the
2298.Xr setsockopt 2
2299.Dv SO_RCVBUF
2300and
2301.Dv SO_SNDBUF
2302options.
2303.It Li proc.pid.rlimit.vmemoryuse ( Dv PROC_PID_LIMIT_AS )
2304The maximum size (in bytes) which a process can obtain.
2305.It Li proc.pid.rlimit.maxlwp ( Dv PROC_PID_LIMIT_NTHR )
2306The maximum number of threads that cen be created and running at one time in
2307the process.
2308The first thread of each process is not counted against this.
2309.El
2310.Pp
2311The fifth level name is one of
2312.Li soft ( Dv PROC_PID_LIMIT_TYPE_SOFT )
2313or
2314.Li hard ( Dv PROC_PID_LIMIT_TYPE_HARD ) ,
2315to select respectively the soft or hard limit.
2316Both are of type integer.
2317.It Li proc.pid.stopfork ( Dv PROC_PID_STOPFORK )
2318If non zero, the process' children will be stopped after
2319.Xr fork 2
2320calls.
2321The children are created in the SSTOP state and are never scheduled
2322for running before being stopped.
2323This feature enables attaching to a process with a debugger such as
2324.Xr gdb 1
2325before the process has the opportunity to actually do anything.
2326.Pp
2327This value is inherited by the process's children, and it also
2328applies to emulation specific system calls that fork a new process, such as
2329.Fn sproc
2330or
2331.Fn clone .
2332.It Li proc.pid.stopexec ( Dv PROC_PID_STOPEXEC )
2333If non zero, the process will be stopped on the next
2334.Xr exec 3
2335call.
2336The process created by
2337.Xr exec 3
2338is created in the SSTOP state and is never scheduled for running
2339before being stopped.
2340This feature enables attaching to a process with a debugger such as
2341.Xr gdb 1
2342before the process has the opportunity to actually do anything.
2343.Pp
2344This value is inherited by the process's children.
2345.It Li proc.pid.stopexit ( Dv PROC_PID_STOPEXIT )
2346If non zero, the process will be stopped when it has cause to exit,
2347either by way of calling
2348.Xr exit 3 ,
2349.Xr _exit 2 ,
2350or by the receipt of a specific signal.
2351The process is stopped before any of its resources or vm space is
2352released allowing examination of the termination state of the process
2353before it disappears.
2354This feature can be used to examine the final conditions of the
2355process's vmspace via
2356.Xr pmap 1
2357or its resource settings with
2358.Xr sysctl 8
2359before it disappears.
2360.Pp
2361This value is also inherited by the process's children.
2362.It Li proc.pid.paxflags ( Dv PROC_PID_PAXFLAGS )
2363This read-only variable returns the current value of the process's pax
2364flags (see
2365.Xr paxctl 8 ) .
2366.El
2367.Ss The user.* subtree ( Dv CTL_USER )
2368The string and integer information available for the
2369.Li user
2370level is detailed below.
2371The changeable column shows whether a process with appropriate
2372privilege may change the value.
2373.Bl -column "user.coll_weights_max" "integer" "Changeable" -offset indent
2374.It Sy Second level name Ta Sy Type Ta Sy Changeable
2375.It user.atexit_max	integer	no
2376.It user.bc_base_max	integer	no
2377.It user.bc_dim_max	integer	no
2378.It user.bc_scale_max	integer	no
2379.It user.bc_string_max	integer	no
2380.It user.coll_weights_max	integer	no
2381.It user.cs_path	string	no
2382.It user.expr_nest_max	integer	no
2383.It user.line_max	integer	no
2384.It user.posix2_c_bind	integer	no
2385.It user.posix2_c_dev	integer	no
2386.It user.posix2_char_term	integer	no
2387.It user.posix2_fort_dev	integer	no
2388.It user.posix2_fort_run	integer	no
2389.It user.posix2_localedef	integer	no
2390.It user.posix2_sw_dev	integer	no
2391.It user.posix2_upe	integer	no
2392.It user.posix2_version	integer	no
2393.It user.re_dup_max	integer	no
2394.It user.stream_max	integer	no
2395.It user.stream_max	integer	no
2396.It user.tzname_max	integer	no
2397.El
2398.Bl -tag -width "123456"
2399.It Li user.atexit_max ( Dv USER_ATEXIT_MAX )
2400The maximum number of functions that may be registered with
2401.Xr atexit 3 .
2402.It Li user.bc_base_max ( Dv USER_BC_BASE_MAX )
2403The maximum ibase/obase values in the
2404.Xr bc 1
2405utility.
2406.It Li user.bc_dim_max ( Dv USER_BC_DIM_MAX )
2407The maximum array size in the
2408.Xr bc 1
2409utility.
2410.It Li user.bc_scale_max ( Dv USER_BC_SCALE_MAX )
2411The maximum scale value in the
2412.Xr bc 1
2413utility.
2414.It Li user.bc_string_max ( Dv USER_BC_STRING_MAX )
2415The maximum string length in the
2416.Xr bc 1
2417utility.
2418.It Li user.coll_weights_max ( Dv USER_COLL_WEIGHTS_MAX )
2419The maximum number of weights that can be assigned to any entry of
2420the LC_COLLATE order keyword in the locale definition file.
2421.It Li user.cs_path ( USER_CS_PATH )
2422Return a value for the
2423.Ev PATH
2424environment variable that finds all the standard utilities.
2425.It Li user.expr_nest_max ( Dv USER_EXPR_NEST_MAX )
2426The maximum number of expressions that can be nested within
2427parenthesis by the
2428.Xr expr 1
2429utility.
2430.It Li user.line_max ( Dv USER_LINE_MAX )
2431The maximum length in bytes of a text-processing utility's input
2432line.
2433.It Li user.posix2_char_term ( Dv USER_POSIX2_CHAR_TERM )
2434Return 1 if the system supports at least one terminal type capable of
2435all operations described in
2436.St -p1003.2 ,
2437otherwise\ 0.
2438.It Li user.posix2_c_bind ( Dv USER_POSIX2_C_BIND )
2439Return 1 if the system's C-language development facilities support the
2440C-Language Bindings Option, otherwise\ 0.
2441.It Li user.posix2_c_dev ( Dv USER_POSIX2_C_DEV )
2442Return 1 if the system supports the C-Language Development Utilities Option,
2443otherwise\ 0.
2444.It Li user.posix2_fort_dev ( Dv USER_POSIX2_FORT_DEV )
2445Return 1 if the system supports the FORTRAN Development Utilities Option,
2446otherwise\ 0.
2447.It Li user.posix2_fort_run ( Dv USER_POSIX2_FORT_RUN )
2448Return 1 if the system supports the FORTRAN Runtime Utilities Option,
2449otherwise\ 0.
2450.It Li user.posix2_localedef ( Dv USER_POSIX2_LOCALEDEF )
2451Return 1 if the system supports the creation of locales, otherwise\ 0.
2452.It Li user.posix2_sw_dev ( Dv USER_POSIX2_SW_DEV )
2453Return 1 if the system supports the Software Development Utilities Option,
2454otherwise\ 0.
2455.It Li user.posix2_upe ( Dv USER_POSIX2_UPE )
2456Return 1 if the system supports the User Portability Utilities Option,
2457otherwise\ 0.
2458.It Li user.posix2_version ( Dv USER_POSIX2_VERSION )
2459The version of
2460.St -p1003.2
2461with which the system attempts to comply.
2462.It Li user.re_dup_max ( Dv USER_RE_DUP_MAX )
2463The maximum number of repeated occurrences of a regular expression
2464permitted when using interval notation.
2465.It Li user.stream_max ( Dv USER_STREAM_MAX )
2466The minimum maximum number of streams that a process may have open
2467at any one time.
2468.It Li user.tzname_max ( Dv USER_TZNAME_MAX )
2469The minimum maximum number of types supported for the name of a
2470timezone.
2471.El
2472.Ss The vm.* subtree ( Dv CTL_VM )
2473The string and integer information available for the
2474.Li vm
2475level is detailed below.
2476The changeable column shows whether a process with appropriate
2477privilege may change the value.
2478.Bl -column "Second level name" "struct uvmexp_sysctl" "Changeable" -offset indent
2479.It Sy Second level name Ta Sy Type Ta Sy Changeable
2480.It vm.anonmax	int	yes
2481.It vm.anonmin	int	yes
2482.It vm.bufcache	int	yes
2483.It vm.bufmem	int	no
2484.It vm.bufmem_hiwater	int	yes
2485.It vm.bufmem_lowater	int	yes
2486.It vm.execmax	int	yes
2487.It vm.execmin	int	yes
2488.It vm.filemax	int	yes
2489.It vm.filemin	int	yes
2490.It vm.loadavg	struct loadavg	no
2491.It vm.maxslp	int	no
2492.It vm.nkmempages	int	no
2493.It vm.uspace	int	no
2494.It vm.uvmexp	struct uvmexp	no
2495.It vm.uvmexp2	struct uvmexp_sysctl	no
2496.It vm.vmmeter	struct vmtotal	no
2497.It vm.proc.map	struct kinfo_vmentry	no
2498.It vm.guard_size	unsigned int	no
2499.It vm.thread_guard_size	unsigned int	yes
2500.It vm.swap_encrypt	bool	yes
2501.El
2502.Bl -tag -width "123456"
2503.It Li vm.anonmax ( Dv VM_ANONMAX )
2504The percentage of physical memory which will be reclaimed
2505from other types of memory usage to store anonymous application data.
2506.It Li vm.anonmin ( Dv VM_ANONMIN )
2507The percentage of physical memory which will be always be available for
2508anonymous application data.
2509.It Li vm.bufcache ( Dv VM_BUFCACHE )
2510The percentage of physical memory which will be available
2511for the buffer cache.
2512.It Li vm.bufmem ( Dv VM_BUFMEM )
2513The amount of kernel memory that is being used by the buffer cache.
2514.It Li vm.bufmem_lowater ( Dv VM_BUFMEM_LOWATER )
2515The minimum amount of kernel memory to reserve for the
2516buffer cache.
2517.It Li vm.bufmem_hiwater ( Dv VM_BUFMEM_HIWATER )
2518The maximum amount of kernel memory to be used for the
2519buffer cache.
2520.It Li vm.execmax ( Dv VM_EXECMAX )
2521The percentage of physical memory which will be reclaimed
2522from other types of memory usage to store cached executable data.
2523.It Li vm.execmin ( Dv VM_EXECMIN )
2524The percentage of physical memory which will be always be available for
2525cached executable data.
2526.It Li vm.filemax ( Dv VM_FILEMAX )
2527The percentage of physical memory which will be reclaimed
2528from other types of memory usage to store cached file data.
2529.It Li vm.filemin ( Dv VM_FILEMIN )
2530The percentage of physical memory which will be always be available for
2531cached file data.
2532.It Li vm.loadavg ( Dv VM_LOADAVG )
2533Return the load average history.
2534The returned data consists of a
2535.Vt struct loadavg .
2536.It Li vm.maxslp ( Dv VM_MAXSLP )
2537The value of the maxslp kernel global variable.
2538.It Li vm.vmmeter ( Dv VM_METER )
2539Return system wide virtual memory statistics.
2540The returned data consists of a
2541.Vt struct vmtotal .
2542.It vm.user_va0_disable
2543A flag which controls whether user processes can map virtual address\ 0.
2544.It Li vm.proc.map ( Dv VM_PROC )
2545The third level is
2546.Dv VM_PROC_MAP ,
2547the fourth is the pid of the process to display the vm object entries for, and
2548the fifth is the size of
2549.Vt struct kinfo_vmentry .
2550Returns an array of
2551.Vt struct kinfo_vmentry
2552objects.
2553.It Li vm.ubc_direct Bq Sy "EXPERIMENTAL" Ns No , default off
2554Use direct map for UBC I/O, avoiding need to map and unmap buffer memory.
2555Speeds up operation for fast I/O devices like NVMe, especially
2556on multi-CPU systems.
2557Only available on some architectures.
2558.It Li vm.uspace ( Dv VM_USPACE )
2559The number of bytes allocated for each kernel stack.
2560.It Li vm.uvmexp ( Dv VM_UVMEXP )
2561Return system wide virtual memory statistics.
2562The returned data consists of a
2563.Vt struct uvmexp .
2564.It Li vm.uvmexp2 ( Dv VM_UVMEXP2 )
2565Return system wide virtual memory statistics.
2566The returned data consists of a
2567.Vt struct uvmexp_sysctl .
2568.It Li vm.guard_size
2569Return system wide guard size for the main thread of a program.
2570.It Li vm.thread_guard_size
2571Return system wide default size for the guard area of all other threads
2572of a program.
2573.It Li vm.swap_encrypt Bq Sy "EXPERIMENTAL" Ns No , default off
2574If true, encrypt data while swapped out to disk.
2575.Pp
2576Each swap device maintains an independent AES-256 key, generated when
2577the first page is swapped to that device.
2578Each page is swapped independently using AES-CBC, with an
2579initialization vector chosen by the encryption under the AES-256 key of
2580the little-endian swap slot number padded to 128 bits with zeros.
2581(This is essentially the
2582.Xr cgd 4
2583.Sq encblkno1
2584method.)
2585.Pp
2586Changes to
2587.Li vm.swap_encrypt
2588only affect pages of swap newly written out.
2589To force encrypting or decrypting all existing swap, or to rekey
2590previously encrypted swap, you can remove the swap devices and re-add
2591them with
2592.Xr swapctl 8 ,
2593with the caveat that whatever pages were already written to disk
2594unencrypted or encrypted with a compromised key may still be written to
2595disk afterward.
2596.El
2597.Ss The ddb.* subtree ( Dv CTL_DDB )
2598The information available for the
2599.Li ddb
2600level is detailed below.
2601The changeable column shows whether a process with appropriate
2602privilege may change the value.
2603.Bl -column "Second level name" "integer" "Changeable" -offset indent
2604.It Sy Second level name Ta Sy Type Ta Sy Changeable
2605.It ddb.commandonenter	string	yes
2606.It ddb.dumpstack 	integer	yes
2607.It ddb.fromconsole	integer	yes
2608.It ddb.lines	integer	yes
2609.It ddb.maxoff	integer	yes
2610.It ddb.maxwidth	integer	yes
2611.It ddb.onpanic	integer	yes
2612.It ddb.panicstackframes	integer	yes
2613.It ddb.radix	integer	yes
2614.It ddb.tabstops	integer	yes
2615.It ddb.tee_msgbuf	integer	yes
2616.El
2617.Bl -tag -width "123456"
2618.It Li ddb.commandonenter
2619If not empty, the string is used as the DDB command to be executed each time
2620DDB is entered.
2621.It Li ddb.dumpstack
2622A value of 1 causes a stack trace to be printed on entering ddb from a panic.
2623A value of 0 disables this behaviour.
2624The default value is 1.
2625.It Li ddb.fromconsole ( Dv DDBCTL_FROMCONSOLE )
2626If not zero, DDB may be entered by sending a break on a serial
2627console or by a special key sequence on a graphics console.
2628.It Li ddb.lines ( Dv DDBCTL_LINES )
2629Number of display lines.
2630.It Li ddb.maxoff ( Dv DDBCTL_MAXOFF )
2631The maximum symbol offset.
2632.It Li ddb.maxwidth ( Dv DDBCTL_MAXWIDTH )
2633The maximum output line width.
2634.It Li ddb.onpanic ( Dv DDBCTL_ONPANIC )
2635If greater than zero, DDB will be entered if the kernel panics.
2636A value of 1 causes the system to enter DDB on panic.
2637A value of 0 causes the kernel to attempt to print a stack trace, then
2638reboot, while a value of \-1 means neither a stack trace will be printed
2639nor DDB entered.
2640.It Li ddb.panicstackframes
2641Number of stack frames to display on panic.
2642Useful to avoid scrolling away the interesting frames on a glass tty.
2643Default value is
2644.Dv 65535
2645(all frames), useful value around
2646.Dv 10 .
2647.It Li ddb.radix ( Dv DDBCTL_RADIX )
2648The input and output radix.
2649.It Li ddb.tabstops ( Dv DDBCTL_TABSTOPS )
2650Tab width.
2651.It Li ddb.tee_msgbuf
2652If not zero, DDB will output also to the kernel message buffer.
2653.El
2654.Pp
2655Some of these MIB
2656nodes are also available as variables from within the debugger.
2657See
2658.Xr ddb 4
2659for more details.
2660.Ss The security.* subtree ( Dv CTL_SECURITY )
2661The
2662.Li security
2663level contains various security-related settings for
2664the system.
2665The available second level names are:
2666.Bl -column "Second level name" "integer" "Changeable" -offset indent
2667.It Sy Second level name Ta Sy Type Ta Sy Changeable
2668.It Li security.curtain	integer	yes
2669.It Li security.models	node	not applicable
2670.It Li security.pax	node	not applicable
2671.El
2672.Pp
2673Available settings are detailed below.
2674.Bl -tag -width "123456"
2675.It Li security.curtain
2676If non-zero, will filter return objects according to the user ID
2677requesting information about them, preventing users from
2678accessing any objects they do not own.
2679.Pp
2680At the moment, it affects
2681.Xr ps 1 ,
2682.Xr netstat 1
2683(for
2684.Dv PF_INET ,
2685.Dv PF_INET6 ,
2686and
2687.Dv PF_UNIX
2688PCBs), and
2689.Xr w 1 .
2690.It Li security.models
2691.Nx
2692supports pluggable security models.
2693Every security model used, whether if loaded as a module or built with the system,
2694is required to add an entry to this node with at least one element,
2695.Dq name ,
2696indicating the name of the security model.
2697.Pp
2698In addition to the name, any settings and other information private to the
2699security model will be available under this node.
2700See
2701.Xr secmodel 9
2702for more information.
2703.It Li security.pax
2704Settings for PaX \(em exploit mitigation features.
2705For more information on any of the PaX features, please see
2706.Xr paxctl 8
2707and
2708.Xr security 7 .
2709The available third and fourth level names are:
2710.Bl -column "security.pax.segvguard.suspend_timeout" "integer" "Changeable" \
2711-offset 2n
2712.It Sy Third and fourth level names Ta Sy Type Ta Sy Changeable
2713.It Li security.pax.aslr.enabled	integer	yes
2714.\".It Li security.pax.aslr.exec_len	integer	yes
2715.It Li security.pax.aslr.global	integer	yes
2716.\".It Li security.pax.aslr.mmap_len	integer	yes
2717.\".It Li security.pax.aslr.stack_len	integer	yes
2718.It Li security.pax.mprotect.enabled	integer	yes
2719.It Li security.pax.mprotect.global	integer	yes
2720.It Li security.pax.mprotect.ptrace	integer	yes
2721.It Li security.pax.segvguard.enabled	integer	yes
2722.It Li security.pax.segvguard.expiry_timeout	integer	yes
2723.It Li security.pax.segvguard.global	integer	yes
2724.It Li security.pax.segvguard.max_crashes	integer	yes
2725.It Li security.pax.segvguard.suspend_timeout	integer	yes
2726.El
2727.Bl -tag -width "123456"
2728.It Li security.pax.aslr.enabled
2729Enable PaX ASLR (Address Space Layout Randomization).
2730.Pp
2731The value of this
2732knob must be non-zero for PaX ASLR to be enabled, even if a program is set to
2733explicit enable.
2734.\".It Li security.pax.aslr.exec_len
2735.\" XXX: Undocumented.
2736.It Li security.pax.aslr.global
2737Specifies the default global policy for programs without an
2738explicit enable/disable flag.
2739.Pp
2740When non-zero, all programs will get PaX ASLR, except those exempted with
2741.Xr paxctl 8 .
2742Otherwise, all programs will not get PaX ASLR, except those specifically
2743marked as such with
2744.Xr paxctl 8 .
2745.\".It Li security.pax.aslr.mmap_len
2746.\" XXX: Undocumented.
2747.\" .It Li security.pax.aslr.stack_len
2748.\" XXX: Undocumented.
2749.It Li security.pax.mprotect.enabled
2750Enable PaX MPROTECT restrictions.
2751.Pp
2752These are
2753.Xr mprotect 2
2754restrictions to better enforce a W^X policy.
2755The value of this
2756knob must be non-zero for PaX MPROTECT to be enabled, even if a
2757program is set to explicit enable.
2758.It Li security.pax.mprotect.global
2759Specifies the default global policy for programs without an
2760explicit enable/disable flag.
2761.Pp
2762When non-zero, all programs will get the PaX MPROTECT restrictions,
2763except those exempted with
2764.Xr paxctl 8 .
2765Otherwise, all programs will not get the PaX MPROTECT restrictions,
2766except those specifically marked as such with
2767.Xr paxctl 8 .
2768.It Li security.pax.mprotect.ptrace
2769This variable allows
2770.Xr ptrace 2
2771to override PaX MPROTECT permissions.
2772It can have the following values:
2773.Bl -tag -width XX -compact
2774.It 0
2775Does not let override any permissions.
2776.It 1
2777Disables PaX MPROTECT from processes that start executing while traced (default).
2778.It 2
2779Bypasses PaX MPROTECT for all processes being traced.
2780.El
2781.It Li security.pax.segvguard.enabled
2782Enable PaX Segvguard.
2783.Pp
2784PaX Segvguard can detect and prevent certain exploitation attempts, where
2785an attacker may try for example to brute-force function return addresses
2786of respawning daemons.
2787.Pp
2788.Em Note :
2789The
2790.Nx
2791interface and implementation of the Segvguard is still experimental, and may
2792change in future releases.
2793.It Li security.pax.segvguard.expiry_timeout
2794If the max number was not reached within this timeout (in seconds), the entry
2795will expire.
2796.It Li security.pax.segvguard.global
2797Specifies the default global policy for programs without an
2798explicit enable/disable flag.
2799.Pp
2800When non-zero, all programs will get the PaX Segvguard,
2801except those exempted with
2802.Xr paxctl 8 .
2803Otherwise, no program will get the PaX Segvguard restrictions,
2804except those specifically marked as such with
2805.Xr paxctl 8 .
2806.It Li security.pax.segvguard.max_crashes
2807The maximum number of segfaults a program can receive before suspension.
2808.It Li security.pax.segvguard.suspend_timeout
2809Number of seconds to suspend a user from running a faulting program when the
2810limit was exceeded.
2811.El
2812.El
2813.Ss The vendor.* subtree ( Dv CTL_VENDOR )
2814The
2815.Li vendor
2816toplevel name is reserved to be used by vendors who wish to
2817have their own private MIB tree.
2818Intended use is to store values under
2819.Dq vendor.<yourname>.* .
2820.Sh SEE ALSO
2821.Xr sysctl 3 ,
2822.Xr ipsec 4 ,
2823.Xr tcp 4 ,
2824.Xr security 7 ,
2825.Xr sysctl 8
2826.Sh HISTORY
2827The
2828.Nm
2829variables first appeared in
2830.Bx 4.4 .
2831