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